method tracking documentation in bbn\Appui\Ide
Add or update option file in repository
function(array $file, string $file_code, array $info, bool $setRecent = true)
{
$bit = false;
if (($id_option_opened = $this->options->fromCode(self::OPENED_FILE, self::IDE_PATH, self::BBN_APPUI))) {
//search preference and if not exsist preference add a new
$pref = $this->pref->getByOption($id_option_opened);
$id_pref = !empty($pref) ? $pref['id'] : $this->pref->add($id_option_opened, []);
$pref_file = $this->_backup_preference_files($file, $info, 'create');
if (!empty($pref_file) && !empty($id_pref)) {
$file_path = $file['repository']['name'] . '/' . $file_code;
$bit_data = $this->_get_bit_by_file($pref_file, $id_pref);
if ($bit_data !== null) {
$cfg = [
'cfg' => [
'last_open' => date('Y-m-d H:i:s')
]
];
//set bit why exist
if (!empty($this->pref->updateBit($bit_data['id'], $cfg, true))) {
$bit = true;
}
}
//add bit why not exist
else {
$cfg = [
'last_open' => date('Y-m-d H:i:s')
];
if (
!empty($id_pref) && $this->pref->addBit(
$id_pref,
[
'id_option' => null,
'cfg' => json_encode($cfg),
'text' => $file_path
]
)
) {
$bit = true;
}
}
if ($setRecent) {
return !empty($bit) && !empty($pref_file) && !empty($id_pref) && $this->setRecentFile($file_path);
} else {
return !empty($bit) && !empty($pref_file) && !empty($id_pref);
}
}
}
return $pref_file;
}
Add or update option file in repository 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