method opAlias documentation in bbn\Appui\Option
Returns the merge between an option and its alias as an array.
Example
X::dump($opt->option(25));
X::dump($opt->option('bbn_ide'));
X::dump($opt->option('TEST', 58));
X::dump($opt->option('test', 'users', 'bbn_ide'));
/* Each would return an array of this form
array [
'id' => 25,
'code' => "bbn_ide",
'text' => "This is BBN's IDE",
'myIntProperty' => 56854,
'myTextProperty' => "Hello\nWorld
",
'myArrayProperty' => ['value1' => 1, 'value2' => 2]
]
function($code = NULL)
{
if (bbn\Str::isUid($id = $this->fromCode(\func_get_args()))
&& ($opt = $this->nativeOption($id))
) {
$this->_set_value($opt);
$c =& $this->fields;
if (bbn\Str::isUid($opt[$c['id_alias']]) && ($alias = $this->nativeOption($opt[$c['id_alias']]))) {
if ($opt[$c['id_alias']] === $id) {
throw new \Exception(X::_("Impossible to have the same ID as ALIAS, check out ID").' '.$id);
}
else {
$this->_set_value($alias);
foreach ($alias as $n => $a) {
if (!empty($a)) {
$opt[$n] = $a;
}
}
}
}
return $opt;
}
return null;
}
Returns the merge between an option and its alias as an array. 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.
© 2011-2023
BBN Solutions