public function unload()
    {
        if ($this->_save_later) {
            $this->_save_later = false;
            $this->saveAndUnload();
        }
        $this->hook('beforeUnload');
        $this->id = null;
        // parent::unload();

        if ($this->_save_later) {
            $this->_save_later = false;
            $this->saveAndUnload();
        }
        if ($this->loaded()) {
            $this->hook('beforeUnload');
        }
        $this->data = $this->dirty = array();
        $this->id = null;
        $this->hook('afterUnload');
        //

        $this->hook('afterUnload');

        return $this;
    }
public function unload()
    {
        if ($this->_save_later) {
            $this->_save_later = false;
            $this->saveAndUnload();
        }
        $this->hook('beforeUnload');
        $this->id = null;
        // parent::unload();

        if ($this->_save_later) {
            $this->_save_later = false;
            $this->saveAndUnload();
        }
        if ($this->loaded()) {
            $this->hook('beforeUnload');
        }
        $this->data = $this->dirty = array();
        $this->id = null;
        $this->hook('afterUnload');
        //

        $this->hook('afterUnload');

        return $this;
    }
public function unload ( ) { if ( $ this -> _save_later ) { $ this -> _save_later = false ; $ this -> saveAndUnload ( ) ; } $ this -> hook ( 'beforeUnload' ) ; $ this -> id = null ; // parent::unload(); if ( $ this -> _save_later ) { $ this -> _save_later = false ; $ this -> saveAndUnload ( ) ; } if ( $ this -> loaded ( ) ) { $ this -> hook ( 'beforeUnload' ) ; } $ this -> data = $ this -> dirty = array ( ) ; $ this -> id = null ; $ this -> hook ( 'afterUnload' ) ; // $ this -> hook ( 'afterUnload' ) ; return $ this ; }
forget currently loaded record and it's ID. Will not affect database
forget currently loaded record and it s ID . Will not affect database