src/bbn/appui/cron.php
public function start($id_cron): bool
  {
    $res = false;
    if ( $this->check() && ($cron = $this->get_cron($id_cron)) ){
      bbn\appui\history::disable();
      $start = date('Y-m-d H:i:s');
      if ( $this->db->update($this->table, [
        'prev' => $start,
        'next' => date('Y-m-d H:i:s', $this->get_next_date($cron['cfg']['frequency']))
      ], [
        'id' => $id_cron
      ]) ){
        $res = true;
      }
      bbn\appui\history::enable();
    }
    return $res;
  }
public function start($id_cron): bool
  {
    $res = false;
    if ( $this->check() && ($cron = $this->get_cron($id_cron)) ){
      bbn\appui\history::disable();
      $start = date('Y-m-d H:i:s');
      if ( $this->db->update($this->table, [
        'prev' => $start,
        'next' => date('Y-m-d H:i:s', $this->get_next_date($cron['cfg']['frequency']))
      ], [
        'id' => $id_cron
      ]) ){
        $res = true;
      }
      bbn\appui\history::enable();
    }
    return $res;
  }
public function start ( $ id_cron ) : bool { $ res = false ; if ( $ this -> check ( ) && ( $ cron = $ this -> get_cron ( $ id_cron ) ) ) { bbn \ appui \ history :: disable ( ) ; $ start = date ( 'Y-m-d H:i:s' ) ; if ( $ this -> db -> update ( $ this -> table , [ 'prev' => $ start , 'next' => date ( 'Y-m-d H:i:s' , $ this -> get_next_date ( $ cron [ 'cfg' ] [ 'frequency' ] ) ) ] , [ 'id' => $ id_cron ] ) ) { $ res = true ; } bbn \ appui \ history :: enable ( ) ; } return $ res ; }
Writes in the given CRON row the next start time, the current as previous, and the new running status.
@param $id_cron
@return bool
Writes in the given CRON row the next start time the current as previous and the new running status .