library/Garp/Model/Behavior/FileRelatable.php
public function beforeUpdate(array &$args) {
        $data = &$args[1];
        foreach ($data as $key => $value) {
            /**
             * Save the current file value.
             * If it differs from the given value, it will be cleared
             * by afterUpdate.
             */
            if (in_array($key, $this->_fields)) {
                $this->_newValues[$key] = $value;
                if (!$this->_affectedRows) {
                    $model = $args[0];
                    $where = $args[2];
                    $affectedRows = $model->fetchAll($where);
                    $this->_affectedRows = $affectedRows;
                }
            }
        }
    }
public function beforeUpdate(array &$args) {
        $data = &$args[1];
        foreach ($data as $key => $value) {
            /**
             * Save the current file value.
             * If it differs from the given value, it will be cleared
             * by afterUpdate.
             */
            if (in_array($key, $this->_fields)) {
                $this->_newValues[$key] = $value;
                if (!$this->_affectedRows) {
                    $model = $args[0];
                    $where = $args[2];
                    $affectedRows = $model->fetchAll($where);
                    $this->_affectedRows = $affectedRows;
                }
            }
        }
    }
public function beforeUpdate ( array & $ args ) { $ data = & $ args [ 1 ] ; foreach ( $ data as $ key => $ value ) { /**
             * Save the current file value.
             * If it differs from the given value, it will be cleared
             * by afterUpdate.
             */ if ( in_array ( $ key , $ this -> _fields ) ) { $ this -> _newValues [ $ key ] = $ value ; if ( ! $ this -> _affectedRows ) { $ model = $ args [ 0 ] ; $ where = $ args [ 2 ] ; $ affectedRows = $ model -> fetchAll ( $ where ) ; $ this -> _affectedRows = $ affectedRows ; } } } }
Before update callback. Save the original file values here.
If they have changed afterUpdate, clear them.
@param Array $options The new data is in $args[0]
@return Array Or throw Exception if you wish to stop the insert
Before update callback . Save the original file values here . If they have changed afterUpdate clear them .