选择语言 :

 Module_OOP_ORM_Data::delete

删除对象数据

integer Module_OOP_ORM_Data::delete( )
throws
Exception
返回值
  • integer 操作行数
File: ./modules/oop/orm/data.class.php
public function delete()
{
    $orm = $this->orm();
    $status = 0;
    $id_field = $this->get_id_field_name();
    if ( $id_field )
    {
        $where[$id_field] = $this->$id_field;
    }
    else
    {
        throw new Exception('ORM:' . get_class($orm) . '不存在ID字段,无法使用ORM系统自带的delete方法删除。');
    }
    $status = $orm->delete($where);

    $this->_remove_id_cache_data();

    return $status;
}