method removeFull documentation in bbn\Appui\Option

Deletes an option row with all it's hierarchical structure from the options table and deletes the cache.

Example

X::dump($opt->removeFull(12)); // (int) 12 Number of options deleted X::dump($opt->removeFull(12)); // (null) The option doesn't exist anymore function($code) { if (bbn\Str::isUid($id = $this->fromCode(\func_get_args())) && ($id !== $this->default) && ($id !== $this->root) ) { $res = 0; $this->deleteCache($id); $all = $this->treeIds($id); $has_history = History::isEnabled() && History::isLinked($this->class_cfg['table']); foreach (array_reverse($all) as $a){ if ($has_history) { $res += (int)$this->db->delete('bbn_history_uids', ['bbn_uid' => $a]); } else{ $res += (int)$this->db->delete($this->class_cfg['table'], [$this->fields['id'] => $a]); } } return $res; } return null; }

Deletes an option row with all it's hierarchical structure from the options table and deletes the cache. 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.