public function destroy($conditions = false)
    {
        $this->andWhere($conditions);
        !$this->loaded && $this->loadData(0);

        if (!$this->isColl) {
            $this->triggerCallback('beforeDestroy');
            $this->executeDestroy();
            $this->isDestroyed = true;
            $this->triggerCallback('afterDestroy');
        } else {
            foreach ($this->data as $record) {
                $record->destroy();
            }
        }

        return $this;
    }
public function destroy($conditions = false)
    {
        $this->andWhere($conditions);
        !$this->loaded && $this->loadData(0);

        if (!$this->isColl) {
            $this->triggerCallback('beforeDestroy');
            $this->executeDestroy();
            $this->isDestroyed = true;
            $this->triggerCallback('afterDestroy');
        } else {
            foreach ($this->data as $record) {
                $record->destroy();
            }
        }

        return $this;
    }
public function destroy ( $ conditions = false ) { $ this -> andWhere ( $ conditions ) ; ! $ this -> loaded && $ this -> loadData ( 0 ) ; if ( ! $ this -> isColl ) { $ this -> triggerCallback ( 'beforeDestroy' ) ; $ this -> executeDestroy ( ) ; $ this -> isDestroyed = true ; $ this -> triggerCallback ( 'afterDestroy' ) ; } else { foreach ( $ this -> data as $ record ) { $ record -> destroy ( ) ; } } return $ this ; }
Delete the current record and trigger the beforeDestroy and afterDestroy callback

@param mixed $conditions
@return $this
Delete the current record and trigger the beforeDestroy and afterDestroy callback