原则实体对象到数组
2022-08-30 19:57:23
想将教义 entiry 对象转换为普通数组,这是我到目前为止的代码,
$demo = $this->doctrine->em->find('Entity\User',2);
获取实体对象 ,
Entity\User Object
(
[id:Entity\User:private] => 2
[username:Entity\User:private] => TestUser
[password:Entity\User:private] => 950715f3f83e20ee154995cd5a89ac75
[email:Entity\User:private] => test@test.com
[firm_id:Entity\User:private] => Entity\Firm Object
(
[id:Entity\Firm:private] => 16
[company_name:Entity\Firm:private] => TestFirm
[company_detail:Entity\Firm:private] => India
[created_at:Entity\Firm:private] => DateTime Object
(
[date] => 2014-08-01 18:16:08
[timezone_type] => 3
[timezone] => Europe/Paris
)
[user:Entity\Firm:private] =>
)
[created_at:Entity\User:private] => DateTime Object
(
[date] => 2014-08-01 15:12:36
[timezone_type] => 3
[timezone] => Europe/Paris
)
[updated_at:Entity\User:private] => DateTime Object
(
[date] => 2014-08-01 15:12:36
[timezone_type] => 3
[timezone] => Europe/Paris
)
[firm:protected] =>
) ,
试过这个,但根据我的要求,我不想doctrine_query用户。谢谢。