Beispiel #1
0
 /**
  * Removes the relation between $object and $relatedObject.
  *
  * This method is used to delete an existing relation between 2 objects.
  * Like {@link addRelatedObject()} this method does not store the related
  * object after removing its relation properties (unset), except for {@link
  * ezcPersistentManyToManyRelation()}s, for which the relation record is
  * deleted from the database.
  *
  * If between the classes of $object and $relatedObject multiple relations
  * are defined using a {@link ezcPersistentRelationCollection}, the
  * $relationName parameter becomes necessary. It defines which exact
  * relation to affect here.
  *
  * Removal of related objects is reflected in the identity map
  * automatically and also in named related object sets.
  *
  * @param ezcPersistentObject $object        Source object of the relation.
  * @param ezcPersistentObject $relatedObject Related object.
  * @param string $relationName
  *
  * @throws ezcPersistentRelationOperationNotSupportedException
  *         if a relation to create is marked as "reverse".
  * @throws ezcPersistentRelationNotFoundException
  *         if the deisred relation is not defined.
  */
 public function removeRelatedObject($object, $relatedObject, $relationName = null)
 {
     $this->session->removeRelatedObject($object, $relatedObject, $relationName);
     $this->identityMap->removeRelatedObject($object, $relatedObject, $relationName);
 }