src/Observers/EntityMergers/GenericCompositeEntityMerger.php
/**
     * Merge's and return's the entity with the passed attributes.
     *
     * @param \TechDivision\Import\Observers\ObserverInterface $observer The observer instance to detect the state for
     * @param array                                            $entity   The entity loaded from the database
     * @param array                                            $attr     The entity data from the import file
     *
     * @return array The entity attributes that has to be merged
     * @throws \InvalidArgumentException Is thrown, if one of the elements does not implement the expected interface
     */
Merge's and return's the entity with the passed attributes.
@param \TechDivision\Import\Observers\ObserverInterface $observer The observer instance to detect the state for
@param array                                            $entity   The entity loaded from the database
@param array                                            $attr     The entity data from the import file

@return array The entity attributes that has to be merged
@throws \InvalidArgumentException Is thrown, if one of the elements does not implement the expected interface
Merge ' s and return ' s the entity with the passed attributes . @param \ TechDivision \ Import \ Observers \ ObserverInterface $observer The observer instance to detect the state for @param array $entity The entity loaded from the database @param array $attr The entity data from the import file @return array The entity attributes that has to be merged @throws \ InvalidArgumentException Is thrown if one of the elements does not implement the expected interface
public function merge(ObserverInterface $observer, array $entity, array $attr) : array
    {
        foreach ($this as $key => $entityMerger) {
            if ($entityMerger instanceof EntityMergerInterface) {
                $attr = $entityMerger->merge($observer, $entity, $attr);
            } else {
                throw new \InvalidArgumentException(
                    sprintf('Element #%d doesn\'t implement expected interface "TechDivision\Import\Observers\EntityMergers\EntityMergerInterface"', $key)
                );
            }
        }
        return $attr;
    }
public function merge ( ObserverInterface $ observer , array $ entity , array $ attr ) : array { foreach ( $ this as $ key => $ entityMerger ) { if ( $ entityMerger instanceof EntityMergerInterface ) { $ attr = $ entityMerger -> merge ( $ observer , $ entity , $ attr ) ; } else { throw new \ InvalidArgumentException ( sprintf ( 'Element #%d doesn\'t implement expected interface "TechDivision\Import\Observers\EntityMergers\EntityMergerInterface"' , $ key ) ) ; } } return $ attr ; }
Merge's and return's the entity with the passed attributes.
Merge ' s and return ' s the entity with the passed attributes .
// invoke the entity mergers // return the entity attributes that has to be merged