method update documentation in bbn\Appui\Planning
Updates a planning row and, if necessary, the linked event
function(string $id_planning, string $id_staff, $event, string $id_alias = NULL, string $alias = NULL)
{
if (
\bbn\Str::isUid($id_planning) &&
\bbn\Str::isUid($id_staff) &&
(
\bbn\Str::isUid($event) ||
(\is_array($event) && \bbn\Str::isUid($event[$this->ecfg['arch']['events']['id']]))
) &&
(\bbn\Str::isUid($id_alias) || \is_null($id_alias)) &&
(\bbn\Str::isDateSql($alias) || \is_null($alias))
){
$id_event = \is_array($event) ? $event[$this->ecfg['arch']['events']['id']] : $event;
$ok = $this->db->update($this->class_table, [
$this->fields['id_staff'] => $id_staff,
$this->fields['id_event'] => $id_event,
$this->fields['id_alias'] => $id_alias,
$this->fields['alias'] => \bbn\Str::isDateSql($alias) ? date('Y-m-d', strtotime($alias)) : null
], [
$this->fields['id'] => $id_planning
]);
$ok2 = \is_array($event) ? $this->events->edit($id_event, $event) : false;
return (bool)$ok || (bool)$ok2;
}
return false;
}
Updates a planning row and, if necessary, the linked event 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