library/Garp/Model/Behavior/Bitlyable.php
public function beforeUpdate(array &$args) {
        $model = $args[0];
        $data = &$args[1];
        $where = $args[2];

        // When updating, it's quite possible {$this->_column} is not in $data.
        // If so, collect it live.
        if (empty($data[$this->_column])) {
            $row = $model->fetchRow($where);
            if ($row->{$this->_column}) {
                $data[$this->_column] = $row->{$this->_column};
            }
        }
        $this->_setBitlyUrl($data);
    }
public function beforeUpdate(array &$args) {
        $model = $args[0];
        $data = &$args[1];
        $where = $args[2];

        // When updating, it's quite possible {$this->_column} is not in $data.
        // If so, collect it live.
        if (empty($data[$this->_column])) {
            $row = $model->fetchRow($where);
            if ($row->{$this->_column}) {
                $data[$this->_column] = $row->{$this->_column};
            }
        }
        $this->_setBitlyUrl($data);
    }
public function beforeUpdate ( array & $ args ) { $ model = $ args [ 0 ] ; $ data = & $ args [ 1 ] ; $ where = $ args [ 2 ] ; // When updating, it's quite possible {$this->_column} is not in $data. // If so, collect it live. if ( empty ( $ data [ $ this -> _column ] ) ) { $ row = $ model -> fetchRow ( $ where ) ; if ( $ row -> { $ this -> _column } ) { $ data [ $ this -> _column ] = $ row -> { $ this -> _column } ; } } $ this -> _setBitlyUrl ( $ data ) ; }
Before update callback
@param Array $args
#return Void
Before update callback