You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$FObj = $this->getFormatObject();
$FObj->col('XXXXX')
->col('XXXXX')
->row('XXXXX')
->full('XXXXX')
->full('XXXXX');
$FObj->apply_row() // run all function added by $FObj->row(...)
->apply_col() // run all function added by $FObj->col(...)
->apply_full() // run all function added by $FObj->full(...) $FObj->getData() //return final format data
Format Methods
Format::arrayHasMany
$FObj->full('Post.arrayHasMany',array('Post','Comment','id'));
/* Array( [0] => Array ( [Post] => Array ( [id] => 1 [title] => The title [Comment] => Array ( [0] => Array ( [id] => 1 [content] => But I must explain to [post_id] => 1 [created] => 2017-03-01 ) ) ) ) [1] => Array ( [Post] => Array ( [id] => 2 [title] => A title once again [Comment] => Array ( [0] => Array ( [id] => 3 [content] => Far far away, behind the word mountains, far from the countries Vokalia and [post_id] => 2 [created] => 2017-03-01 ) [1] => Array ( [id] => 4 [content] => One morning, when Gregor Samsa woke from troubled dreams, he [post_id] => 2 [created] => 2017-03-01 ) ) ) ) */
Format::arrayHasOne
$FObj->full('Post.arrayHasOne',array('Post','User','id'));
/* Array( [0] => Array ( [Post] => Array ( [id] => 1 [title] => The title [User] => Array ( [id] => 2 [name] => raymond ) ) ) [1] => Array ( [Post] => Array ( [id] => 2 [title] => A title once again [User] => Array ( [id] => 1 [name] =>joe ) ) ) */