polyfony-inc/polyfony

Implement a Entity->hasChanged(?string $attribute_name)

Opened this issue · 0 comments

public function hasChanged(?string $attribute_name = null) :bool {
    // are we checking an attribute or the whole object ?
    return $attribute_name ? 
        // checks if a specific attribute has changed
        in_array($attribute_name, $this->_['altered']) : 
        // check if the object has changed
        count($this->_['altered']) > 1
}