fuelphp-orm

Warning: spl_object_hash() expects parameter 1 to be object

自古美人都是妖i 提交于 2019-12-25 17:19:07
问题 Warning: spl_object_hash() expects parameter 1 to be object, string given in /var/www/sitetwo/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php line 1367 I created MainBlogBundle with Category.php and Product.php using yml mapping annotation via php app/console commands. After using CRUD actions for add/edit/delete/show actions I tried to add a category and after submitting Add category form I get the Warning: spl_object_hash() expects parameter 1 to be object, string given in /var/www

How do I return JSON Arrays instead of objects using FuelPHP's ORM and Controller_Rest

最后都变了- 提交于 2019-12-12 02:55:58
问题 Controller_Something extends Controller_Rest { public function get_something() { $query = Model_Something::query()->related('hasMany')->get(); return $this->response($query); } } Returns: { stuff: here, looks: good, hasMany: { 151251: { id: 151251, other: stuff } } } I want the relations as arrays: { stuff: here, looks: good, hasMany: [ { id: 151251, other: stuff } ] } This happens because the ORM returns related result arrays with keys corresponding to the record's PKEY, and JSON interprets