本文整理汇总了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
示例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());
}
示例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;
}
示例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;
}
示例5: equals
public function equals(Task $that)
{
return $this->getTitle() === $that->getTitle() && $this->getDescription() === $that->getDescription();
}