public function execute($request) { $this->resource = $request->getAttribute('sf_route')->resource; $this->physicalObjects = array(); foreach (QubitRelation::getRelatedSubjectsByObjectId('QubitPhysicalObject', $this->resource->id, array('typeId' => QubitTerm::HAS_PHYSICAL_OBJECT_ID)) as $item) { $this->physicalObjects[$item->id] = $item; } if (1 > count($this->physicalObjects)) { return sfView::NONE; } }
/** * Get all physical objects related to this info object * */ public function getPhysicalObjects() { $relatedPhysicalObjects = QubitRelation::getRelatedSubjectsByObjectId('QubitPhysicalObject', $this->id, array('typeId' => QubitTerm::HAS_PHYSICAL_OBJECT_ID)); return $relatedPhysicalObjects; }