本文整理汇总了PHP中Task::setProject方法的典型用法代码示例。如果您正苦于以下问题:PHP Task::setProject方法的具体用法?PHP Task::setProject怎么用?PHP Task::setProject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Task
的用法示例。
在下文中一共展示了Task::setProject方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: runTask
protected function runTask(Project $project, Task $task)
{
// Add if the client has not already done so
if (!$task->getProject()) {
$task->setProject($project);
}
$task->main();
}
示例2: addTask
public function addTask()
{
$projectId = $this->request_stack["arguments"][0];
$task = new Task();
$taskId = $task->setProject(ProjectQuery::create()->findOneById($projectId))->setEmployee(EmployeeQuery::create()->findOneById((new Cookie())->get("employee_id")))->save();
$redirect = new Request();
$redirect->redirect("task", "edit", array("id" => $task->getId()));
}
示例3: init
/**
* Executes initialization actions required to setup the data structures
* related to the tag.
* <p>
* This includes:
* <ul>
* <li>creation of the task object</li>
* <li>calling the setters for attributes</li>
* <li>adding the task to the container object</li>
* <li>adding a reference to the task (if id attribute is given)</li>
* <li>executing the task if the container is the <project>
* element</li>
* </ul>
*
* @param string $tag The tag that comes in
* @param array $attrs Attributes the tag carries
* @throws ExpatParseException if attributes are incomplete or invalid
*/
function init($tag, $attrs)
{
// shorthands
try {
$configurator = $this->configurator;
$project = $this->configurator->project;
$this->task = $project->createTask($tag);
} catch (BuildException $be) {
// swallow here, will be thrown again in
// UnknownElement->maybeConfigure if the problem persists.
print "Swallowing exception: " . $be->getMessage() . "\n";
}
// if the task is not known beforehand, wrap it
// in an UnknownElement object to enable runtime configuration
// NB: this is also done for ConditionBase objects to allow
// dynamic conditions without breaking BC for all tasks
if ($this->task === null) {
$this->task = new UnknownElement($tag);
$this->task->setProject($project);
$this->task->setTaskType($tag);
$this->task->setTaskName($tag);
}
// add file position information to the task (from parser)
// should be used in task exceptions to provide details
$this->task->setLocation($this->parser->getLocation());
$configurator->configureId($this->task, $attrs);
if ($this->container) {
$this->container->addTask($this->task);
}
// Top level tasks don't have associated targets
// FIXME: if we do like Ant 1.6 and create an implicitTarget in the projectconfigurator object
// then we don't need to check for null here ... but there's a lot of stuff that will break if we
// do that at this point.
if ($this->target !== null) {
$this->task->setOwningTarget($this->target);
$this->task->init();
$this->wrapper = $this->task->getRuntimeConfigurableWrapper();
$this->wrapper->setAttributes($attrs);
/*
Commenting this out as per thread on Premature configurate of ReuntimeConfigurables
with Matthias Pigulla: http://phing.tigris.org/servlets/ReadMsg?list=dev&msgNo=251
if ($this->parentWrapper !== null) { // this may not make sense only within this if-block, but it
// seems to address current use cases adequately
$this->parentWrapper->addChild($this->wrapper);
}
*/
} else {
$this->task->init();
$configurator->configure($this->task, $attrs, $project);
}
}
示例4: createTask
/**
* @param $taskName
* @param $taskDesc
* @param $taskDueDate
* @param $taskStatus
* @param null $userId
* @param null $projectId
* @return bool
* @throws \Exception
*/
public function createTask($taskName, $taskDesc, $taskDueDate, $taskStatus, $userId = null, $projectId = null)
{
$task = new Task();
$task->setTitle($taskName);
$task->setDescription($taskDesc);
$task->setDueDate(new \DateTime($taskDueDate));
$task->setStatus($taskStatus);
if ($projectId) {
$project = $this->em->getRepository('AppBundle:Project');
$task->setProject($project->find($project_id));
}
if ($userId) {
$user = $this->em->getRepository('AppBundle:User');
$task->setUser($user->find($useId));
}
try {
$this->em->persist($task);
$this->em->flush();
return true;
} catch (\Exception $e) {
throw $e;
}
}
示例5: setProject
/**
* @see ProjectComponent::setProject()
*/
public function setProject(Project $project)
{
parent::setProject($project);
$this->fileset->setProject($project);
}
示例6: addTask
public function addTask(Task $l)
{
$this->collTasks[] = $l;
$l->setProject($this);
}