Skip to content
Advertisement

Tag: collections

Flatten laravel relationship collection / array

I am having problem with array convert I went use laravel collection using map Or php array Array ( [0] => Array ( [id] => 3487 [title_fa] => Father [code] => 01 [father_id] => 0 [webmaster_id] => 8 [grandchildren] => Array ( [id] => 3488 [title_fa] => Child 1 [code] => 02 [father_id] => 3487 [grandchildren] => ) ) [1]

Doctrine – Hydrate collection in Entity class

I have a problem regarding a bi-directional OneToMany <-> ManyToOne relationship between my entities Device and Event. This is how mapping looks: The problem comes because Device is a Single Table Inheritance entity and each time I fetch and iterate over some Event entities, then $device is always eagerly fetched. This happens because it’s a STI entity as reported in

Advertisement