src/Venturecraft/Revisionable/Revisionable.php
private function changedRevisionableFields()
    {
        $changes_to_record = array();
        foreach ($this->dirtyData as $key => $value) {
            // check that the field is revisionable, and double check
            // that it's actually new data in case dirty is, well, clean
            if ($this->isRevisionable($key) && !is_array($value)) {
                if (!isset($this->originalData[$key]) || $this->originalData[$key] != $this->updatedData[$key]) {
                    $changes_to_record[$key] = $value;
                }
            } else {
                // we don't need these any more, and they could
                // contain a lot of data, so lets trash them.
                unset($this->updatedData[$key]);
                unset($this->originalData[$key]);
            }
        }

        return $changes_to_record;
    }
private function changedRevisionableFields()
    {
        $changes_to_record = array();
        foreach ($this->dirtyData as $key => $value) {
            // check that the field is revisionable, and double check
            // that it's actually new data in case dirty is, well, clean
            if ($this->isRevisionable($key) && !is_array($value)) {
                if (!isset($this->originalData[$key]) || $this->originalData[$key] != $this->updatedData[$key]) {
                    $changes_to_record[$key] = $value;
                }
            } else {
                // we don't need these any more, and they could
                // contain a lot of data, so lets trash them.
                unset($this->updatedData[$key]);
                unset($this->originalData[$key]);
            }
        }

        return $changes_to_record;
    }
private function changedRevisionableFields ( ) { $ changes_to_record = array ( ) ; foreach ( $ this -> dirtyData as $ key => $ value ) { // check that the field is revisionable, and double check // that it's actually new data in case dirty is, well, clean if ( $ this -> isRevisionable ( $ key ) && ! is_array ( $ value ) ) { if ( ! isset ( $ this -> originalData [ $ key ] ) || $ this -> originalData [ $ key ] != $ this -> updatedData [ $ key ] ) { $ changes_to_record [ $ key ] = $ value ; } } else { // we don't need these any more, and they could // contain a lot of data, so lets trash them. unset ( $ this -> updatedData [ $ key ] ) ; unset ( $ this -> originalData [ $ key ] ) ; } } return $ changes_to_record ; }
Get all of the changes that have been made, that are also supposed
to have their changes recorded

@return array fields with new data, that should be recorded
Get all of the changes that have been made that are also supposed to have their changes recorded