private function reloadByState($stateId) { $c = new Criteria(); $c->add(JobPeer::STATUS_ID, $stateId); $this->routeObject = StatusPeer::retrieveByPK($stateId); $this->route = "job_list_by"; $this->propelType = "state"; $this->renderStatus = false; $this->viewingCaption = $this->routeObject->__toString(); return $c; }
public static function setJobStateIds($jobs, $stateId) { $c1 = new Criteria(); $c2 = new Criteria(); $c1->add(JobPeer::ID, $jobs, Criteria::IN); $c2->add(JobPeer::STATUS_ID, $stateId); BasePeer::doUpdate($c1, $c2, Propel::getConnection()); $state = StatusPeer::retrieveByPK($stateId); foreach ($jobs as $id) { $logEntry = new Log(); $logEntry->setWhen(time()); $logEntry->setPropelClass("Job"); $logEntry->setSfGuardUserProfileId(sfContext::getInstance()->getUser()->getUserId()); $logEntry->setMessage("Changed job state to " . $state->getState()); $logEntry->setLogMessageTypeId(sfConfig::get("app_log_type_change_status")); $logEntry->setPropelId($id); $logEntry->save(); } }
public function getStatus($con = null) { if ($this->aStatus === null && $this->status_id !== null) { include_once 'lib/model/om/BaseStatusPeer.php'; $this->aStatus = StatusPeer::retrieveByPK($this->status_id, $con); } return $this->aStatus; }
/** * Get the associated Status object * * @param Connection Optional Connection object. * @return Status The associated Status object. * @throws PropelException */ public function getStatus($con = null) { if ($this->aStatus === null && $this->status_id !== null) { // include the related Peer class include_once 'lib/model/om/BaseStatusPeer.php'; $this->aStatus = StatusPeer::retrieveByPK($this->status_id, $con); /* The following can be used instead of the line above to guarantee the related object contains a reference to this object, but this level of coupling may be undesirable in many circumstances. As it can lead to a db query with many results that may never be used. $obj = StatusPeer::retrieveByPK($this->status_id, $con); $obj->addStatuss($this); */ } return $this->aStatus; }
<!-- Status properties used in this document --> <?php foreach ($statusArray as $statusId) { $status = StatusPeer::retrieveByPK($statusId); /** * @todo Use the real vocabulary instead of the separate table in the DB **/ ?> <skos:Concept rdf:about="<?php echo $status->getUri(); ?> "> <skos:prefLabel xml:lang="en"><?php echo $status->getDisplayName(); ?> </skos:prefLabel> </skos:Concept> <?php }