method codeOptions documentation in bbn\Appui\Option

Returns an array of full options arrays for a given parent

Example

X::dump($opt->codeOptions(12)); /* array [ 'code_1' => [ 'id' => 21, 'code' => 'code_1', 'text' => 'text_1' ], 'code_2' => [ 'id' => 22, 'code' => 'code_2', 'text' => 'text_2' ], ] function($code = NULL) { if (bbn\Str::isUid($id = $this->fromCode(\func_get_args()))) { $list = $this->items($id); if (\is_array($list)) { $res = []; foreach ($list as $i){ $o = $this->option($i); $res[$o[$this->fields['code']]] = [ $this->fields['id'] => $o[$this->fields['id']], $this->fields['code'] => $o[$this->fields['code']], $this->fields['text'] => $o[$this->fields['text']] ]; } return $res; } } return null; }

Returns an 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.