public function purgeAttributes($attributesToPurge = null)
    {
        if ($attributesToPurge !== null) {
            $purgeable = is_array($attributesToPurge) ? $attributesToPurge : [$attributesToPurge];
        }
        else {
            $purgeable = $this->getPurgeableAttributes();
        }

        $attributes = $this->getAttributes();
        $cleanAttributes = array_diff_key($attributes, array_flip($purgeable));
        $originalAttributes = array_diff_key($attributes, $cleanAttributes);

        if (is_array($this->originalPurgeableValues)) {
            $this->originalPurgeableValues = array_merge($this->originalPurgeableValues, $originalAttributes);
        }
        else {
            $this->originalPurgeableValues = $originalAttributes;
        }

        return $this->attributes = $cleanAttributes;
    }
public function purgeAttributes($attributesToPurge = null)
    {
        if ($attributesToPurge !== null) {
            $purgeable = is_array($attributesToPurge) ? $attributesToPurge : [$attributesToPurge];
        }
        else {
            $purgeable = $this->getPurgeableAttributes();
        }

        $attributes = $this->getAttributes();
        $cleanAttributes = array_diff_key($attributes, array_flip($purgeable));
        $originalAttributes = array_diff_key($attributes, $cleanAttributes);

        if (is_array($this->originalPurgeableValues)) {
            $this->originalPurgeableValues = array_merge($this->originalPurgeableValues, $originalAttributes);
        }
        else {
            $this->originalPurgeableValues = $originalAttributes;
        }

        return $this->attributes = $cleanAttributes;
    }
public function purgeAttributes ( $ attributesToPurge = null ) { if ( $ attributesToPurge !== null ) { $ purgeable = is_array ( $ attributesToPurge ) ? $ attributesToPurge : [ $ attributesToPurge ] ; } else { $ purgeable = $ this -> getPurgeableAttributes ( ) ; } $ attributes = $ this -> getAttributes ( ) ; $ cleanAttributes = array_diff_key ( $ attributes , array_flip ( $ purgeable ) ) ; $ originalAttributes = array_diff_key ( $ attributes , $ cleanAttributes ) ; if ( is_array ( $ this -> originalPurgeableValues ) ) { $ this -> originalPurgeableValues = array_merge ( $ this -> originalPurgeableValues , $ originalAttributes ) ; } else { $ this -> originalPurgeableValues = $ originalAttributes ; } return $ this -> attributes = $ cleanAttributes ; }
Removes purged attributes, used before saving.

@param null $attributesToPurge

@return array Clean attributes
Removes purged attributes used before saving .