src/Observers/AttributeObserverTrait.php
/**
     * Merge's and return's the entity with the passed attributes and set's the
     * passed status.
     *
     * @param array       $entity        The entity to merge the attributes into
     * @param array       $attr          The attributes to be merged
     * @param string|null $changeSetName The change set name to use
     *
     * @return array The merged entity
     */
Merge's and return's the entity with the passed attributes and set's the
passed status.

@param array       $entity        The entity to merge the attributes into
@param array       $attr          The attributes to be merged
@param string|null $changeSetName The change set name to use

@return array The merged entity
Merge ' s and return ' s the entity with the passed attributes and set ' s the passed status . @param array $entity The entity to merge the attributes into @param array $attr The attributes to be merged @param string|null $changeSetName The change set name to use @return array The merged entity
protected function mergeEntity(array $entity, array $attr, $changeSetName = null)
    {
        $this->operation = OperationNames::UPDATE;
        if ($this->attributeValue === '' || $this->attributeValue === null) {
            if (array_key_exists($this->attributeCode, $this->getDefaultColumnValues()) &&
                array_key_exists($this->attributeCode, $this->getCleanUpEmptyColumnKeys()) === false
            ) {
                unset($attr[MemberNames::VALUE]);
            } else {
                $this->operation = OperationNames::DELETE;
            }
        }
        return parent::mergeEntity($entity, $attr, $changeSetName);
    }
protected function mergeEntity ( array $ entity , array $ attr , $ changeSetName = null ) { $ this -> operation = OperationNames :: UPDATE ; if ( $ this -> attributeValue === '' || $ this -> attributeValue === null ) { if ( array_key_exists ( $ this -> attributeCode , $ this -> getDefaultColumnValues ( ) ) && array_key_exists ( $ this -> attributeCode , $ this -> getCleanUpEmptyColumnKeys ( ) ) === false ) { unset ( $ attr [ MemberNames :: VALUE ] ) ; } else { $ this -> operation = OperationNames :: DELETE ; } } return parent :: mergeEntity ( $ entity , $ attr , $ changeSetName ) ; }
Merge's and return's the entity with the passed attributes and set's the
 passed status.
Merge ' s and return ' s the entity with the passed attributes and set ' s the passed status .
// we want to update the attribute, if we're here // query whether or not the column is EMPTY // if the value is empty AND it is IN the array with default column values // BUT it is NOT in the array with columns we want to clean-up the default // column value has to be removed, because we do NOT want to override the // value existing in the database // remove the value from the array with the column values, because // this is the default value from the database and it should NOT // override the value from the entity in that case // otherwise keep the value and DELETE the whole attribute from // the database // merge and return the data