クラスstdClassのオブジェクトを文字列に変換できませんでした
public function get($id = null)
{
$terms = array('id' => $id);
$blog = $this->model->getBy($terms);
// $blog => (object) [id => 1, category_id => 3]
$fix->id = $blog->id;
// $fix->category = $this->getCategory($blog->category_id); // Not work
$fix->cat_or_something = $this->getCategory($blog->category_id); // Work
return $fix;
// $fix => (object) [id => 1, cat_or_something => [name => Some Category]]
}
$fix->category
で変更すれば$fix->cat_or_something
動作します。について奇妙なことがあり$fix->category
ます。