public function execute($request) { $this->resource = $this->getRoute()->resource; if (!isset($this->resource)) { $this->forward404(); } if (!$this->getUser()->isAuthenticated()) { QubitAcl::forwardUnauthorized(); } $criteria = new Criteria(); $criteria->setDistinct(); $criteria->add(QubitInformationObject::LFT, $this->resource->lft, Criteria::GREATER_EQUAL); $criteria->add(QubitInformationObject::RGT, $this->resource->rgt, Criteria::LESS_EQUAL); $criteria->add(QubitRelation::TYPE_ID, QubitTerm::HAS_PHYSICAL_OBJECT_ID); $criteria->addJoin(QubitRelation::OBJECT_ID, QubitInformationObject::ID); $criteria->addJoin(QubitRelation::SUBJECT_ID, QubitPhysicalObject::ID); $this->physicalObjects = QubitPhysicalObject::get($criteria); if (0 == count($this->physicalObjects)) { return sfView::ERROR; } $c2 = clone $criteria; $this->foundcount = BasePeer::doCount($c2)->fetchColumn(0); }
public static function getphysicalObjectsRelatedByparentIdById($id, array $options = array()) { $criteria = new Criteria(); self::addphysicalObjectsRelatedByparentIdCriteriaById($criteria, $id); return QubitPhysicalObject::get($criteria, $options); }