src/db/orm/PersistableObject.php
private function update() {
        // pre-processing hook
        if ($this->beforeUpdate() !== true)
            return $this;

        $mapping = $this->dao()->getMapping();
        $changes = [];

        // collect modified properties and their values
        foreach ($mapping['properties'] as $property) {                 // TODO: Until the dirty check is implemented all
            $propertyName = $property['name'];                          //       properties are assumed dirty.
            $changes[$propertyName] = $this->$propertyName;
        }

        // perform update
        if ($this->doUpdate($changes)) {
            $this->_modified = false;

            // post-processing hook
            $this->afterUpdate();
        }
        return $this;
    }
private function update() {
        // pre-processing hook
        if ($this->beforeUpdate() !== true)
            return $this;

        $mapping = $this->dao()->getMapping();
        $changes = [];

        // collect modified properties and their values
        foreach ($mapping['properties'] as $property) {                 // TODO: Until the dirty check is implemented all
            $propertyName = $property['name'];                          //       properties are assumed dirty.
            $changes[$propertyName] = $this->$propertyName;
        }

        // perform update
        if ($this->doUpdate($changes)) {
            $this->_modified = false;

            // post-processing hook
            $this->afterUpdate();
        }
        return $this;
    }
private function update ( ) { // pre-processing hook if ( $ this -> beforeUpdate ( ) !== true ) return $ this ; $ mapping = $ this -> dao ( ) -> getMapping ( ) ; $ changes = [ ] ; // collect modified properties and their values foreach ( $ mapping [ 'properties' ] as $ property ) { // TODO: Until the dirty check is implemented all $ propertyName = $ property [ 'name' ] ; //       properties are assumed dirty. $ changes [ $ propertyName ] = $ this -> $ propertyName ; } // perform update if ( $ this -> doUpdate ( $ changes ) ) { $ this -> _modified = false ; // post-processing hook $ this -> afterUpdate ( ) ; } return $ this ; }
Update the instance.

@return $this
Update the instance .