method findI18n documentation in bbn\Appui\Option
Returns an array containing all options that have the property i18n set
function($id = NULL, $items = true)
{
$res = [];
if ($this->check()) {
$opts = $this->db->rselectAll(
[
'tables' => [$this->class_cfg['table']],
'fields' => [
$this->fields['id'],
$this->fields['id_parent'],
$this->fields['code'],
$this->fields['text'],
'language' => 'JSON_EXTRACT('.$this->fields['cfg'].', "$.i18n")'
],
'where' => [
[
'field' => 'JSON_EXTRACT('.$this->fields['cfg'].', "$.i18n")',
'operator' => 'isnotnull'
]
]
]
);
if ($opts) {
foreach ($opts as $opt){
if (!empty($items)) {
$res[] = array_merge(
$opt, ['items' => array_values(
array_filter(
$opts, function ($o) use ($opt) {
return $o[$this->fields['id_parent']] === $opt[$this->fields['id']];
}
)
)]
);
}
else {
$res[] = $opt;
}
}
}
}
return $res;
}
Returns an array containing all options that have the property i18n set 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