examples/file_storage/models/TaskFile.php
public function taskSave()
    {
        $taskId = $this->getTaskId();
        $tasks = self::taskFileLoad();
        if (empty($taskId)) {
            $task_ids = array_keys($tasks);
            $this->setTaskId(array_pop($task_ids) + 1);
            $this->setTs(date('Y-m-d H:i:s'));
        }

        $tasks[$this->getTaskId()] = $this;
        return $this->taskFileSave($tasks);
    }
public function taskSave()
    {
        $taskId = $this->getTaskId();
        $tasks = self::taskFileLoad();
        if (empty($taskId)) {
            $task_ids = array_keys($tasks);
            $this->setTaskId(array_pop($task_ids) + 1);
            $this->setTs(date('Y-m-d H:i:s'));
        }

        $tasks[$this->getTaskId()] = $this;
        return $this->taskFileSave($tasks);
    }
public function taskSave ( ) { $ taskId = $ this -> getTaskId ( ) ; $ tasks = self :: taskFileLoad ( ) ; if ( empty ( $ taskId ) ) { $ task_ids = array_keys ( $ tasks ) ; $ this -> setTaskId ( array_pop ( $ task_ids ) + 1 ) ; $ this -> setTs ( date ( 'Y-m-d H:i:s' ) ) ; } $ tasks [ $ this -> getTaskId ( ) ] = $ this ; return $ this -> taskFileSave ( $ tasks ) ; }
Saves the task
@return mixed
Saves the task