method parents documentation in bbn\Appui\Option

Returns an array of id_parents from the option selected to root

Example

X::dump($opt->parents(48)); // array [25, 12, 0] function($code = NULL) { if (bbn\Str::isUid($id = $this->fromCode(\func_get_args()))) { $res = []; while (bbn\Str::isUid($id_parent = $this->getIdParent($id))){ if (\in_array($id_parent, $res, true)) { break; } else{ if ($id === $id_parent) { break; } else{ $res[] = $id_parent; $id = $id_parent; } } } return $res; } return null; }

Returns an array of id_parents from the option selected to root 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.