public function addRelationship(Relationship $relationship) { $this->relationships[$relationship->getId()] = $relationship; }