/** * Save new link to a term. * * @param integer $termId QubitTerm primary key * @param string $relationNote DEPRECATED */ public function setTermRelation($termId, $relationNote = null) { $newTermRelation = new QubitObjectTermRelation(); $newTermRelation->setTermId($termId); //TODO: move to QubitNote // $newTermRelation->setRelationNote($relationNote); $newTermRelation->setObjectId($this->id); $newTermRelation->save(); }
/** * Add a many-to-many Term relation to this information object. * * @param integer $termId primary key of QubitTerm * @param string $relationNote descriptive string (optional) * @return QubitInformationObject $this */ public function addTermRelation($termId, $options = array()) { // Don't add a term relation to this information object that already exists. if ($this->getTermRelation($termId) === null) { $newTermRelation = new QubitObjectTermRelation(); $newTermRelation->setTermId($termId); $this->objectTermRelationsRelatedByobjectId[] = $newTermRelation; } return $this; }