本文整理汇总了PHP中TaskPeer::doSelectOne方法的典型用法代码示例。如果您正苦于以下问题:PHP TaskPeer::doSelectOne方法的具体用法?PHP TaskPeer::doSelectOne怎么用?PHP TaskPeer::doSelectOne使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TaskPeer
的用法示例。
在下文中一共展示了TaskPeer::doSelectOne方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: executeUpdate
public function executeUpdate()
{
$jira = new sfJiraPlugin($this->getUser()->getProfile()->getJiraLogin(), $this->getUser()->getProfile()->getJiraPassword());
$aProjects = $jira->getProjects();
foreach ($aProjects as $project) {
#var_dump( $project );
$c = new Criteria();
$c->add(ProjectPeer::USER_ID, $this->getUser()->getProfile()->getId());
$c->add(ProjectPeer::KEY, $project->key);
$p = ProjectPeer::doSelectOne($c);
$c = new Criteria();
$c->add(UserPeer::JIRA_LOGIN, $project->lead);
$u = UserPeer::doSelectOne($c);
if (empty($p)) {
$p = new Project();
$p->setKey($project->key);
$p->setLeadId(!empty($u) ? $u->getId() : null);
$p->setUserId($this->getUser()->getProfile()->getId());
$p->setName($project->name);
$p->setUpdated(date('r'));
$p->save();
}
$issues = $jira->getIssuesForProject($p->getKey());
foreach ($issues as $issue) {
#die($p->getKey());
if ($issue->assignee == $this->getUser()->getProfile()->getJiraLogin()) {
$c = new Criteria();
$c->add(TaskPeer::KEY, $issue->key);
$t = TaskPeer::doSelectOne($c);
if (empty($t)) {
$c = new Criteria();
$c->add(UserPeer::JIRA_LOGIN, $issue->reporter);
$u = UserPeer::doSelectOne($c);
$t = new Task();
$t->setProjectId($p->getId());
$t->setTitle($issue->summary);
$t->setDescription($issue->description);
$t->setKey($issue->key);
$t->setUpdated(date('r'));
$t->setStatusId($issue->status);
$t->setPriorityId($issue->priority);
$t->setLeadId(!empty($u) ? $u->getId() : null);
$t->save();
}
}
}
}
$this->redirect('@homepage');
return sfView::NONE;
}