Why can't I place this object into an array?
<p>In PHP, you can normally place an object in an array, like so:</p>

<pre><code>class Car{}
$car = new Car();
// This runs without error
$array['vehicle'] = $car;
</code></pre>

<p>I have a custom MVC framework I've built, and I need the controller to get an ORM object from the model, so it can pass that to the view. So, I initialize my user object:</p>

<pre><code>$user = new User(2);
</code></pre>

<p>Now, I want to put that user object into a <code>$data</code> array so it can be passed to the view:</p>

<p>($user->data returns an ORM object)</p>

<pre><code>$array['user'] = $user-&gt;data;
</code></pre>

<p>The problem is, after doing this, I receive the following error:</p>

<pre><code> Object of class ORM could not be converted to string
</code></pre>

<p>What am I doing wrong? Is there something I'm missing?<br>
Thanks for any help in advance.</p>

<h2>Edit: Here's what $user->data refers to, this is from the constructor of <code>class User</code>:</h2>

<pre><code>$this-&gt;data = ORM::for_table("users")-&gt;find_one($this-&gt;user_id);
</code></pre>

<p>(I'm using <a href="https://github.com/j4mie/idiorm" rel="nofollow">Idiorm</a> as an ORM)</p>
