<p>Solution was to call</p>

<pre><code>$productOrCategory  =   new \stdClass();
</code></pre>

CC BY-SA 3.0
2014-12-17T16:13:14.360Z
2014-12-17T16:13:14.360Z
mbalparda
<p>Is there any way to initialize a stdClass? 
Code is simple</p>

<pre><code>    $productOrCategory  =   new stdClass();
    $productOrCategory-&gt;stockFutureDays = 0;
    $productOrCategory-&gt;stockFutureDate = date('ymd');
</code></pre>

<p>but im getting <b>Fatal error</b>:  Class 'Craft\stdClass' not found in <b>Controller.php</b> on line <b>63</b><br /> and line 63 is the first line i added as code.</p>

<plugin-development><plugins>
Class 'Craft\stdClass' not found
# Class 'Craft\stdClass' not found

(Asked by: username_0 on 2014-12-17)

Is there any way to initialize a stdClass? 
Code is simple
    $productOrCategory  =   new stdClass();
    $productOrCategory->stockFutureDays = 0;
    $productOrCategory->stockFutureDate = date('ymd');

but im getting Fatal error:  Class 'Craft\stdClass' not found in Controller.php on line 63 and line 63 is the first line i added as code.

**Tags:** plugin-development, plugins


---

## 1 answers

### Answer by username_0 on 2014-12-17. Score: 7 | Accepted answer

Solution was to call
$productOrCategory  =   new \stdClass();


---

