当前位置: 首页>>代码示例>>PHP>>正文


PHP Task::getName方法代码示例

本文整理汇总了PHP中Task::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP Task::getName方法的具体用法?PHP Task::getName怎么用?PHP Task::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Task的用法示例。


在下文中一共展示了Task::getName方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: add

 /**
  * Add a task to the collection
  *
  * @param Task   $task        The task to be added
  * @param string $description A short description explaining what the task does.
  */
 public function add(Task $task, $description)
 {
     // Descriptions must be provided!
     $description = trim($description);
     if (empty($description)) {
         throw new \InvalidArgumentException('No description provided for ' . $task->getName());
     }
     // Add the task to the internal array
     $this->_tasks[$task->getName()] = array($description, $task);
 }
开发者ID:mothership-ec,项目名称:cog,代码行数:16,代码来源:Collection.php

示例2: testTask

 public function testTask()
 {
     $mock = $this->getMock('stdClass', ['callback']);
     $mock->expects($this->exactly(1))->method('callback');
     $task = new Task('task_name', function () use($mock) {
         $mock->callback();
     });
     $context = $this->getMockBuilder('Deployer\\Task\\Context')->disableOriginalConstructor()->getMock();
     $task->run($context);
     $this->assertEquals('task_name', $task->getName());
     $task->desc('Task description.');
     $this->assertEquals('Task description.', $task->getDescription());
     $task->once();
     $this->assertTrue($task->isOnce());
     $task->onlyOn(['server']);
     $this->assertEquals(['server' => 0], $task->getOnlyOn());
     $this->assertTrue($task->runOnServer('server'));
     $task->onlyOn([]);
     $this->assertTrue($task->runOnServer('server'));
     $task->onlyOn('server');
     $this->assertEquals(['server' => 0], $task->getOnlyOn());
     $this->assertTrue($task->runOnServer('server'));
     $task->onlyOn();
     $this->assertTrue($task->runOnServer('server'));
     $task->setPrivate();
     $this->assertTrue($task->isPrivate());
 }
开发者ID:onedal88,项目名称:deployer,代码行数:27,代码来源:TaskTest.php

示例3: addTask

 /**
  * @param mixed $task
  */
 public function addTask(Task $task)
 {
     if ($this->freePlaceForTasks) {
         $this->tasks[] = $task;
         $this->setFreePlaceForTasks();
         echo $task->getName() . ' is added to tasks', PHP_EOL;
     } else {
         echo 'You can\'t add more task';
     }
 }
开发者ID:Just-Man,项目名称:PHP,代码行数:13,代码来源:AllWork.php

示例4: addTask

 public function addTask(Task $task)
 {
     if ($this->freePlacesForTask > 0) {
         $this->tasks[] = $task;
         $this->freePlacesForTask--;
         echo $task->getName(), " has been added!", PHP_EOL;
     } else {
         echo "You can not add new task!", PHP_EOL;
     }
 }
开发者ID:yoannamiteva,项目名称:it_talents,代码行数:10,代码来源:AllWork.php

示例5: open

 /**
  * Reopen specific object
  *
  * @param void
  * @return null
  */
 function open()
 {
     if ($this->active_task->isNew()) {
         $this->httpError(HTTP_ERR_NOT_FOUND);
     }
     // if
     if (!$this->active_task->canChangeCompleteStatus($this->logged_user)) {
         $this->httpError(HTTP_ERR_FORBIDDEN);
     }
     // if
     if ($this->request->isSubmitted()) {
         db_begin_work();
         $action = $this->active_task->open($this->logged_user);
         if ($action && !is_error($action)) {
             db_commit();
             if ($this->request->getFormat() == FORMAT_HTML) {
                 if ($this->request->get('async')) {
                     $this->smarty->assign(array('_object_task' => $this->active_task));
                     print tpl_fetch(get_template_path('_task_opened_row', $this->controller_name, RESOURCES_MODULE));
                     die;
                 } else {
                     //flash_success('Task ":name" has been opened', array('name' => str_excerpt($this->active_task->getName(), 80, '...')));
                     //bof:mod
                     flash_success('Task ":name" has been opened', array('name' => str_excerpt(strip_tags($this->active_task->getName()), 80, '...')));
                     //eof:mod
                     $this->redirectToReferer($this->active_task->getViewUrl());
                 }
                 // if
             } else {
                 $this->serveData($this->active_task);
             }
             // if
         } else {
             db_rollback();
             if ($this->request->getFormat() == FORMAT_HTML) {
                 if ($this->request->get('async')) {
                     $this->serveData($action);
                 } else {
                     flash_error('Failed to open task ":name"', array('name' => str_excerpt($this->active_task->getName(), 80, '...')));
                     $this->redirectToReferer($this->active_task->getViewUrl());
                 }
                 // if
             } else {
                 $this->httpError(HTTP_ERR_OPERATION_FAILED);
             }
             // if
         }
         // if
     } else {
         $this->httpError(HTTP_ERR_BAD_REQUEST);
     }
     // if
 }
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:59,代码来源:TasksController.class.php

示例6: header

    if (!in_array($_SERVER['REMOTE_ADDR'], array('127.0.0.1'))) {
        echo 'Access denied';
        exit;
    } else {
        header('Content-Type: application/json');
        echo $task->getBebrasJson();
        exit;
    }
}
?>
<!doctype html>
<html>
   <head>
      <meta charset="utf-8">
      <title><?php 
echo $task->getName();
?>
</title>
      <?php 
echo $task->getStaticResourcesImportHtml(Task::MODULES | Task::CONTENT | Task::SOLUTION);
?>
   </head>
   <body <?php 
echo $task->getBodyParametersHtml();
?>
>
      <?php 
echo $task->getContent(Task::CONTENT | Task::SOLUTION);
?>
   </body>
</html>
开发者ID:BebrasTeam,项目名称:BebrasContestServer,代码行数:31,代码来源:index.php

示例7: setCurrentTask

 /**
  * @param Task $currentTask
  */
 public function setCurrentTask($currentTask)
 {
     $this->currentTask = $currentTask;
     echo 'Assigning task ' . $this->currentTask->getName() . ' to ' . $this->name . PHP_EOL;
 }
开发者ID:gpichurov,项目名称:ittalents_season5,代码行数:8,代码来源:Employee.php

示例8: setFormat

 private function setFormat($items)
 {
     $result = array();
     /** @var Item $item */
     foreach ($items as $item) {
         $task = new Task($item->task_id);
         $result[] = array("id" => $item->getId(), "day" => strtolower(date("D", $item->getStart())), "startHour" => date("H", $item->getStart()), "startMinute" => date("i", $item->getStart()), "endHour" => date("H", $item->getEnd()), "endMinute" => date("i", $item->getEnd()), "state" => $item->getStateString(), "feedback" => $item->getFeedback(), "title" => $task->getName(), "color" => $task->getColor());
     }
     return $result;
 }
开发者ID:rezachess,项目名称:Planning,代码行数:10,代码来源:Item_controller.php

示例9: saveTask

 /**
  * Save or update task
  * @param Task $task
  * @return Task
  */
 public function saveTask(Task $task)
 {
     if (is_null($task->getId())) {
         $query = $this->db->prepare("INSERT INTO tasks (name, parameters, status) VALUES (?, ?, ?)");
         $query->execute([$task->getName(), $task->getParameters(), $task->getStatus()]);
         $task->setId($this->db->lastInsertId());
     } else {
         $query = $this->db->prepare("UPDATE tasks SET name = ?, parameters = ?, status = ? WHERE id = ?");
         $query->execute([$task->getName(), $task->getParameters(), $task->getStatus(), $task->getId()]);
     }
     return $task;
 }
开发者ID:andrazk,项目名称:queue_manager,代码行数:17,代码来源:SqlStorage.php


注:本文中的Task::getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。