What I require
I want to add a new property into an object.
var_dump
gives the following result
array (size=1)
0 =>
object(Item)[430]
protected '_node' => null
protected '_id' =>
array (size=1)
'ItemId' => string '4596' (length=4)
protected '_data' =>
array (size=8)
'ItemId' => string '4596' (length=4)
'Id' => string '1055' (length=4)
'employee' => string '40' (length=2)
'project' => string '73' (length=2)
'activity' => string '473' (length=3)
'date' => string '2015-09-28' (length=10)
'duration' => string '28800' (length=5)
'comment' => null
protected '_values' =>
.
.
.
I want to add another property customer
into the object so that the object will look like this
array (size=1)
0 =>
object(Item)[430]
protected '_node' => null
protected '_id' =>
array (size=1)
'ItemId' => string '4596' (length=4)
protected '_data' =>
array (size=8)
'ItemId' => string '4596' (length=4)
'Id' => string '1055' (length=4)
'employee' => string '40' (length=2)
'project' => string '73' (length=2)
'activity' => string '473' (length=3)
'date' => string '2015-09-28' (length=10)
'duration' => string '28800' (length=5)
'comment' => null
'customer' => string '20' (length=2)
protected '_values' =>
.
.
.
How can I do this?
Edit
print_r()
returns
Array
(
[0] => Item Object
(
[_node:protected] =>
[_id:protected] => Array
(
[ItemId] => 4596
)
[_data:protected] => Array
(
[ItemId] => 4596
[Id] => 1055
[employee] => 40
[project] => 73
[activity] => 473
[date] => 2015-09-28
[duration] => 28800
[comment] =>
)
[_values:protected] => Array