protected function _updateSource(array $values, $userId)
    {
        if ($this->tracker->filterChangesOnly($this->_sourceData, $values)) {


            if (\Gems_Tracker::$verbose) {
                $echo = '';
                foreach ($values as $key => $val) {
                    $echo .= $key . ': ' . $this->_sourceData[$key] . ' => ' . $val . "\n";
                }
                \MUtil_Echo::r($echo, 'Updated values for ' . $this->getId());
            }

            if (! isset($values['gso_changed'])) {
                $values['gso_changed'] = new \MUtil_Db_Expr_CurrentTimestamp();
            }
            if (! isset($values['gso_changed_by'])) {
                $values['gso_changed_by'] = $userId;
            }

            // Update values in this object
            $this->_sourceData = $values + $this->_sourceData;

            // return 1;
            return $this->_gemsDb->update('gems__sources', $values, array('gso_id_source = ?' => $this->getId()));

        } else {
            return 0;
        }
    }
protected function _updateSource(array $values, $userId)
    {
        if ($this->tracker->filterChangesOnly($this->_sourceData, $values)) {


            if (\Gems_Tracker::$verbose) {
                $echo = '';
                foreach ($values as $key => $val) {
                    $echo .= $key . ': ' . $this->_sourceData[$key] . ' => ' . $val . "\n";
                }
                \MUtil_Echo::r($echo, 'Updated values for ' . $this->getId());
            }

            if (! isset($values['gso_changed'])) {
                $values['gso_changed'] = new \MUtil_Db_Expr_CurrentTimestamp();
            }
            if (! isset($values['gso_changed_by'])) {
                $values['gso_changed_by'] = $userId;
            }

            // Update values in this object
            $this->_sourceData = $values + $this->_sourceData;

            // return 1;
            return $this->_gemsDb->update('gems__sources', $values, array('gso_id_source = ?' => $this->getId()));

        } else {
            return 0;
        }
    }
protected function _updateSource ( array $ values , $ userId ) { if ( $ this -> tracker -> filterChangesOnly ( $ this -> _sourceData , $ values ) ) { if ( \ Gems_Tracker :: $ verbose ) { $ echo = '' ; foreach ( $ values as $ key => $ val ) { $ echo .= $ key . ': ' . $ this -> _sourceData [ $ key ] . ' => ' . $ val . "\n" ; } \ MUtil_Echo :: r ( $ echo , 'Updated values for ' . $ this -> getId ( ) ) ; } if ( ! isset ( $ values [ 'gso_changed' ] ) ) { $ values [ 'gso_changed' ] = new \ MUtil_Db_Expr_CurrentTimestamp ( ) ; } if ( ! isset ( $ values [ 'gso_changed_by' ] ) ) { $ values [ 'gso_changed_by' ] = $ userId ; } // Update values in this object $ this -> _sourceData = $ values + $ this -> _sourceData ; // return 1; return $ this -> _gemsDb -> update ( 'gems__sources' , $ values , array ( 'gso_id_source = ?' => $ this -> getId ( ) ) ) ; } else { return 0 ; } }
Updates this source, both in the database and in memory.

@param array $values The values that this source should be set to
@param int $userId The current user
@return int 1 if data changed, 0 otherwise
Updates this source both in the database and in memory .