remove() public method

Deletes an entity as part of the current unit of work.
public remove ( object $entity )
$entity object The entity to remove.
Beispiel #1
0
 /**
  * Remove the object from the index
  *
  * @param array|object $objects
  *
  * @throws UnexpectedTypeException
  */
 public function remove($objects)
 {
     if (!is_array($objects) && !$objects instanceof \Traversable) {
         $objects = array($objects);
     }
     foreach ($objects as $object) {
         if (!is_object($object)) {
             throw new UnexpectedTypeException($object, 'object');
         }
         $this->unitOfWork->remove($object);
     }
 }