/** * Add a relation from this info object to a phyical object. Check to make * sure the relationship is unique. * * @param QubitPhysicalObject $physicalObject Subject of relationship * @return QubitInformationObject this object */ public function addPhysicalObject($physicalObject) { // Verify that $physicalObject is really a Physical Object and // Don't add an identical info object -> physical object relationship if (get_class($physicalObject) == 'QubitPhysicalObject' && $this->getPhysicalObject($physicalObject->id) === null) { $relation = new QubitRelation(); $relation->setSubject($physicalObject); $relation->setTypeId(QubitTerm::HAS_PHYSICAL_OBJECT_ID); $this->relationsRelatedByobjectId[] = $relation; } return $this; }