當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Task::getTitle方法代碼示例

本文整理匯總了PHP中Task::getTitle方法的典型用法代碼示例。如果您正苦於以下問題:PHP Task::getTitle方法的具體用法?PHP Task::getTitle怎麽用?PHP Task::getTitle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Task的用法示例。


在下文中一共展示了Task::getTitle方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: date

    if ($formattedDeadline !== false) {
        $formattedDeadline = date("Y-m-d H:i:s", $formattedDeadline);
        $task->setDeadline($formattedDeadline);
    }
    if ($numNeeded != '') {
        $task->setNumNeeded($numNeeded);
    }
    $task->save();
    // save uploaded files to database
    foreach ($_POST['file'] as $stored => $orig) {
        $stored = Filter::text($stored);
        $orig = Filter::text($orig);
        Upload::saveToDatabase($orig, $stored, Upload::TYPE_TASK, $task->getID(), $project->getID());
    }
    // log it
    $logEvent = new Event(array('event_type_id' => 'create_task', 'project_id' => $project->getID(), 'user_1_id' => Session::getUserID(), 'item_1_id' => $task->getID(), 'data_1' => $task->getTitle(), 'data_2' => $task->getDescription()));
    $logEvent->save();
    // we're done here
    Session::setMessage('You created a new task.');
    $json = array('success' => '1', 'successUrl' => Url::task($task->getID()));
    echo json_encode($json);
} elseif ($action == 'edit') {
    // flag default is false; assume nothing is modified to start
    $modified = false;
    // is title modified?
    if ($title != $task->getTitle()) {
        // save changes
        $oldTitle = $task->getTitle();
        $task->setTitle($title);
        $task->save();
        // log it
開發者ID:malimu,項目名稱:Pipeline,代碼行數:31,代碼來源:task.process.php

示例2: shouldCreateNewTask

 /**
  * @test
  */
 public function shouldCreateNewTask()
 {
     $task = new Task('Sample Title', 'Sample Description');
     $this->assertEquals('Sample Title', $task->getTitle());
     $this->assertEquals('Sample Description', $task->getDescription());
 }
開發者ID:mybuilder,項目名稱:conductor,代碼行數:9,代碼來源:TaskTest.php

示例3: updateTask

    /**
     * Update the task clicked on
     * @param $userId the user editing
     * @param Task $task object containing task
     * @return bool true if updated
     */
    public function updateTask($userId, Task $task)
    {
        $sql = <<<SQL
UPDATE {$this->tableName}
SET title=?, notes=?, priority=?
WHERE userid=? AND id=?
SQL;
        $pdo = $this->pdo();
        $statement = $pdo->prepare($sql);
        $statement->execute(array($task->getTitle(), $task->getNotes(), $task->getPriority(), $userId, $task->getId()));
        if ($statement->rowCount() === 0) {
            return false;
        }
        return true;
    }
開發者ID:patelas7,項目名稱:mi362ss16,代碼行數:21,代碼來源:Tasks.php

示例4: InsertNewTask

 public function InsertNewTask(Task $task = null)
 {
     if ($task == null || !$task instanceof Task) {
         return null;
     }
     $props = array("UserID," => $task->getUserID(), "ProjectID," => $task->getProjectID(), "Title," => $task->getTitle(), "Date," => $task->getDate(), "TargetHours," => $task->getTargetHours(), "ActualHours," => $task->getActualHours(), "Description," => $task->getDescription(), "IsComplete" => $task->getIsComplete());
     foreach ($props as $k => $v) {
         if ($v != null) {
             if ($k == "IsComplete") {
                 $_props[$k] = "{$v}";
             } else {
                 if (gettype($v) == "string") {
                     $_props[$k] = "'" . $v . "', ";
                 } else {
                     $_props[$k] = "{$v}, ";
                 }
             }
         }
     }
     $this->_dbAdapt->IStatement($this->dbTbl, $_props);
     $tmp = $this->_dbAdapt->getLnk();
     $tmp->query($this->_dbAdapt->getQry());
     unset($tmp);
     return true;
 }
開發者ID:B4RN3SCODE,項目名稱:ASPM,代碼行數:25,代碼來源:TaskServiceAdapter.php

示例5: equals

 public function equals(Task $that)
 {
     return $this->getTitle() === $that->getTitle() && $this->getDescription() === $that->getDescription();
 }
開發者ID:mybuilder,項目名稱:conductor,代碼行數:4,代碼來源:Task.php


注:本文中的Task::getTitle方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。