method publish documentation in bbn\Appui\Cms
Publish a note.
function(string $id_note, array $cfg)
{
if ($this->note->get($id_note) && !$this->isPublished($id_note)) {
//if $url is given it updates the note_url
if (!empty($cfg['url'])) {
try {
$this->setUrl($id_note, $cfg['url']);
}
catch (Exception $e) {
return [
'error' => $e->getMessage()
];
}
}
if (!empty($this->note->hasUrl($id_note))) {
if (empty($this->getEvent($id_note))) {
return $this->setEvent($id_note, [
'start' => $cfg['start'] ?? date('Y-m-d H:i:s'),
'end' => $cfg['end'] ?? null,
'id_type' => $cfg['id_type'] ?? self::$_id_event ?? null
]);
} else {
//case update
return $this->updateEvent($id_note, [
'start' => $cfg['start'] ?? date('Y-m-d H:i:s'),
'end' => $cfg['end'] ?? null,
'id_type' => $cfg['id_type'] ?? self::$_id_event ?? null
]);
}
} else {
return false;
}
}
return false;
}
Publish a note. 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