method update documentation in bbn\Appui\Task

function($id_task, $prop, $value) { $ok = false; if ( $prop === 'deadline' ){ $prev = $this->db->selectOne('bbn_tasks', 'deadline', ['id' => $id_task]); if ( !$prev && $value ){ $this->addLog($id_task, 'deadline_insert', [$value]); $ok = 1; } else if ( $prev && !$value ){ $this->addLog($id_task, 'deadline_delete', [$value]); $ok = 1; } if ( $prev && $value && ($prev !== $value) ){ $this->addLog($id_task, 'deadline_update', [$prev, $value]); $ok = 1; } } else if ( $prop === 'price' ){ $prev = $this->db->selectOne('bbn_tasks', 'price', ['id' => $id_task]); if ( !$prev && $value ){ $this->addLog($id_task, 'price_insert', [$value]); $ok = 1; } else if ( $prev && !$value ){ $this->addLog($id_task, 'price_delete', [$prev]); $ok = 1; } if ( $prev && $value && ($prev !== $value) ){ $this->addLog($id_task, 'price_update', [$prev, $value]); $ok = 1; } } else if ( $prop === 'state' ){ $states = $this->states(); switch ( $value ){ case $states['closed']: $ok = 1; $this->addLog($id_task, 'task_close'); $this->stopAllTracks($id_task); break; case $states['holding']: $ok = 1; $this->addLog($id_task, 'task_hold'); $this->stopAllTracks($id_task); break; case $states['ongoing']: $ok = 1; $this->addLog($id_task, 'task_start'); break; case $states['opened']: $ok = 1; $this->addLog($id_task, 'task_reopen'); break; case $states['unapproved']: $this->addLog($id_task, 'task_unapproved'); $this->stopAllTracks($id_task); $ok = 1; break; } } else if ( $prev = $this->db->selectOne('bbn_tasks', $prop, ['id' => $id_task]) ){ $ok = 1; $this->addLog($id_task, $prop.'_update', [$prev, $value]); } if ( $ok ){ return $this->db->update('bbn_tasks', [$prop => $value], ['id' => $id_task]); } } return false; }

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.