I'm trying set a varible session with an array of objects in a Symfony Controller. I had tried $session->set('expedients', serialize($expedients)); and $session->set('expedients', $expedients); too; but the next step, when I go to get the variable into a new variable in another controller, what I must do to get the original array of objects? My result by the moment is: `
object(Doctrine\ORM\PersistentCollection)#923 (9) {
["snapshot":"Doctrine\ORM\PersistentCollection":private]=> array(0) { }
["owner":"Doctrine\ORM\PersistentCollection":private]=> NULL
["association":"Doctrine\ORM\PersistentCollection":private]=> NULL
["em":"Doctrine\ORM\PersistentCollection":private]=> NULL
["backRefFieldName":"Doctrine\ORM\PersistentCollection":private]=> NULL
["typeClass":"Doctrine\ORM\PersistentCollection":private]=> NULL
["isDirty":"Doctrine\ORM\PersistentCollection":private]=> bool(false)
["collection":protected]=> object(Doctrine\Common\Collections\ArrayCollection)#925 (1) {
["elements":"Doctrine\Common\Collections\ArrayCollection":private]=> array(0) { } }
["initialized":protected]=> bool(false)
}
$session->set('expedients', $expedients->toArray());->toArray()work but not quite; take your option ;-) Thanks.