public function changed($attrs=false) 
    {
        $changes = array();
        $cls     = get_called_class();

        foreach (self::$_columns[$cls] as $column) {
            // if is the primary key or one of the automatic columns, skip
            if ($cls::getPK() == $column || in_array(strtolower($column), array("created_at","updated_at"))) {
                continue;
            }

            $cur = $this->get($column);         // current value
            $old = $this->get($column, false);  // old value

            // if same value, didn't change
            if ($cur == $old) {
                continue;
            }

            // set the value as the changed column name
            $value = $column;

            // if checking the attributes, return an array with both values
            if ($attrs) {
                $value = array($old, $cur);
                $changes[$column] = $value;
            } else {
                array_push($changes, $value);
            }
        }
        return $changes;
    }
public function changed($attrs=false) 
    {
        $changes = array();
        $cls     = get_called_class();

        foreach (self::$_columns[$cls] as $column) {
            // if is the primary key or one of the automatic columns, skip
            if ($cls::getPK() == $column || in_array(strtolower($column), array("created_at","updated_at"))) {
                continue;
            }

            $cur = $this->get($column);         // current value
            $old = $this->get($column, false);  // old value

            // if same value, didn't change
            if ($cur == $old) {
                continue;
            }

            // set the value as the changed column name
            $value = $column;

            // if checking the attributes, return an array with both values
            if ($attrs) {
                $value = array($old, $cur);
                $changes[$column] = $value;
            } else {
                array_push($changes, $value);
            }
        }
        return $changes;
    }
public function changed ( $ attrs = false ) { $ changes = array ( ) ; $ cls = get_called_class ( ) ; foreach ( self :: $ _columns [ $ cls ] as $ column ) { // if is the primary key or one of the automatic columns, skip if ( $ cls :: getPK ( ) == $ column || in_array ( strtolower ( $ column ) , array ( "created_at" , "updated_at" ) ) ) { continue ; } $ cur = $ this -> get ( $ column ) ; // current value $ old = $ this -> get ( $ column , false ) ; // old value // if same value, didn't change if ( $ cur == $ old ) { continue ; } // set the value as the changed column name $ value = $ column ; // if checking the attributes, return an array with both values if ( $ attrs ) { $ value = array ( $ old , $ cur ) ; $ changes [ $ column ] = $ value ; } else { array_push ( $ changes , $ value ) ; } } return $ changes ; }
Return what changed

@param boolean $attrs if true, return old and current values

@return changes
Return what changed