Doctrine findBy* methods and fetch array

后端 未结 4 752
孤街浪徒
孤街浪徒 2021-01-20 15:59

What is the cleanest way of using the Doctrine findBy methods but getting an array returned and not objects.

Doctrine::getTable(\'Table\')->findOneById(x)         


        
4条回答
  •  星月不相逢
    2021-01-20 16:57

    You can specify the hydration mode when using magic finders, like so:

    Doctrine_Core::getTable('Table')->findOneById($x, Doctrine_Core::HYDRATE_ARRAY);
    

提交回复
热议问题