method createOptionPermission documentation in bbn\User\Permissions

function(array $item) { if (X::hasProps($item, ['id_parent', 'id_alias'], true)) { $cf = $this->opt->getClassCfg(); $co =& $cf['arch']['options']; $res = 0; $children = false; $id = $this->db->selectOne( $cf['table'], $co['id'], [ $co['id_parent'] => $item['id_parent'], $co['id_alias'] => $item['id_alias'] ] ); if (!empty($item['items'])) { $children = $item['items']; unset($item['items']); } if (!$id) { $item['text'] = null; $id = $this->opt->add($item); if ($id) { $res++; } } elseif ($this->opt->text($id)) { $this->db->update( $cf['table'], [ $co['text'] => null, $co['cfg'] => null, $co['value'] => null ], [$co['id'] => $id] ); } if ($id && $children) { //die(var_dump($subitems, $item)); foreach ($children as $it) { $it['id_parent'] = $id; $res += (int)$this->createOptionPermission($it); } } return $res; } return null; }

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.