src/Titon/Model/Model.php
public function mapData(array $data) {
        $this->flush();

        if (!empty($data[$this->primaryKey])) {
            $this->_exists = true;
        }

        $this->_original = Hash::exclude($data, $this->reserved);
        $this->_attributes = $data;

        return $this;
    }
public function mapData(array $data) {
        $this->flush();

        if (!empty($data[$this->primaryKey])) {
            $this->_exists = true;
        }

        $this->_original = Hash::exclude($data, $this->reserved);
        $this->_attributes = $data;

        return $this;
    }
public function mapData ( array $ data ) { $ this -> flush ( ) ; if ( ! empty ( $ data [ $ this -> primaryKey ] ) ) { $ this -> _exists = true ; } $ this -> _original = Hash :: exclude ( $ data , $ this -> reserved ) ; $ this -> _attributes = $ data ; return $ this ; }
When data is mapped through the constructor, set the exists flag if necessary,
and save the original data state to monitor for changes.

@param array $data
@return $this
When data is mapped through the constructor set the exists flag if necessary and save the original data state to monitor for changes .