public function remove(\obo\Entity $entity) { if ($this->connectViaPropertyWithName !== "") { $entity->setValueForPropertyWithName(null, $this->connectViaPropertyWithName); $entity->save(); } elseif ($this->connectViaRepositoryWithName !== "") { $ownerManagerName = $this->owner->entityInformation()->managerName; $ownerManagerName::dataStorage()->removeRelationshipBetweenEntities($this->connectViaRepositoryWithName, [$this->owner, $entity]); } else { throw new \obo\Exceptions\Exception("This relationship is not well configured"); } }