示例#1
0
 /**
  * Convenience method to delete an association to another object without invoking the
  * GenericORMapper directly.
  *
  * @param string $relationName The relation to delete.
  * @param GenericORMapperDataObject $targetObject The object to delete the current domain object's relation from.
  *
  * @throws GenericORMapperException In case the data component is not initialized.
  *
  * @author Christian Achatz, Ralf Schubert
  * @version
  * Version 0.1, 30.10.2010<br />
  */
 public function deleteAssociation($relationName, GenericORMapperDataObject $targetObject)
 {
     // check weather data component is there
     if ($this->dataComponent === null) {
         throw new GenericORMapperException('[GenericDomainObject::deleteAssociation()] ' . 'The data component is not initialized, so related objects cannot be loaded! ' . 'Please use the or mapper\'s createAssociation() method or call ' . 'setDataComponent($orm), where $orm is an instance of the or mapper, on this ' . 'object first!', E_USER_ERROR);
     }
     // delete association as desired
     $this->dataComponent->deleteAssociation($relationName, $this, $targetObject);
 }