method fullOptionsByCode documentation in bbn\Appui\Option

Returns code-indexed array of full options arrays for a given parent

Example

X::dump($opt->fullOptionsByCode(12)); /* array [ 'code_1' => ['id' => 21, 'id_parent' => 12, 'title' => "My option 21", 'myProperty' => "78%"], 'code_2' => ['id' => 22, 'id_parent' => 12, 'title' => "My option 22", 'myProperty' => "26%"], 'code_3' => ['id' => 25, 'id_parent' => 12, 'title' => "My option 25", 'myProperty' => "50%"], 'code_4' => ['id' => 27, 'id_parent' => 12, 'title' => "My option 27", 'myProperty' => "40%"] ] function($code = NULL) { $res = []; if ($opt = $this->fullOptions(\func_get_args())) { $cf = $this->getFields(); foreach ($opt as $o){ $res[$o[$cf['code']]] = $o; } } return $opt === null ? $opt : $res; }

Returns code-indexed array of full options arrays for a given parent BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way

This website uses cookies to ensure you get the best experience on our website.