私はJsonサービスにDooPHPを使用していますが、1つの問題を除いてすべて問題ありません。DooPHPのMysql Ormが不潔な結果を生成しました(すべての構成を試しました)。
私はモデルを持っています:
public $id;
public $name;
public $content;
public $image_small;
public $image_large;
public $category_id;
public $orderday;
public $creat_time;
public $_table = 'recipe';
public $_primarykey = 'id';
public $_fields = array('id','name','content','image_small','image_large','category_id','orderday','creat_time');
そして、私はこのようなクエリを書きます:
$food = Doo::db()->find('Recipe',array('select' => 'id, name, image_small, image_large,category_id'));
しかし、配列の結果:(SELECT id、name、image_small、image_large、category_id FROMレシピ)
Array
(
[0] => Recipe Object
(
[id] => 1
[name] => Chicken
[content] =>
[image_small] => image_small/0872c3146bc78b74a006b41353aab13c.jpg
[image_large] => image_large/0872c3146bc78b74a006b41353aab13c.jpg
[category_id] => 1
[orderday] =>
[creat_time] =>
[_table] => recipe
[_primarykey] => id
[_fields] => Array
(
[0] => id
[1] => name
[2] => content
[3] => image_small
[4] => image_large
[5] => category_id
[6] => orderday
[7] => creat_time
)
)
[1] => Recipe Object
(
[id] => 3
[name] => Bak Kut Teh 2
[content] =>
[image_small] =>
[image_large] =>
[category_id] => 4
[orderday] =>
[creat_time] =>
[_table] => recipe
[_primarykey] => id
[_fields] => Array
(
[0] => id
[1] => name
[2] => content
[3] => image_small
[4] => image_large
[5] => category_id
[6] => orderday
[7] => creat_time
)
)
)
速度(_fields、_table ..)で、content、creat_time..を選択しないすべての無関係なデータを削除したい。