method setDefault documentation in bbn\Appui\Option

Makes an option act as if it was the root option

It will be the default $id_parent for options requested by code

Example

X::dump($opt->getDefault()); // (int) 0 // Default root option $new = $opt->fromCode('test'); // false // Option not found $opt->setDefault($new); // Default is now 5 X::dump($opt->getDefault()); // (int) 5 X::dump($opt->fromCode('test)); // (int) 24 // Returns the ID (24) of a child of option 5 with code 'test' $opt->setDefault(); // Default is back to root X::dump($opt->getDefault()); // (int) 0 function($uid) { if ($this->check() && $this->exists($uid)) { $this->default = $uid; } return $this; }

Makes an option act as if it was the root option 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.