delete() 공개 메소드

Deletes a record from the backend. $object can be either a primary key, an Rdo_Query object, or an Rdo object.
public delete ( string | Horde_Rdo_Base | Horde_Rdo_Query $object ) : integer
$object string | Horde_Rdo_Base | Horde_Rdo_Query The Rdo object, Horde_Rdo_Query, or unique id to delete.
리턴 integer Number of objects deleted.
예제 #1
0
파일: StockMapper.php 프로젝트: horde/horde
 /**
  * Deletes a stock item from the backend. $object can be either a
  * primary key, an Rdo_Query object, or a Sesha_Entity_Stock object.
  * This also cleans up attached attributes and categories
  *
  * @param string|Sesha_Entity_Stock|Horde_Rdo_Query $object The Rdo object,
  * Horde_Rdo_Query, or unique id to delete.
  *
  * @return integer Number of objects deleted.
  */
 public function delete($object)
 {
     if (!$object instanceof Sesha_Entity_Stock) {
         $object = $this->findOne($object);
     }
     foreach ($object->values as $value) {
         $value->delete();
     }
     $object->removeRelation('categories');
     return parent::delete($object);
 }