src/Observers/GenericCompositeObserver.php
/**
     * Will be invoked by the observer visitor when a factory has been defined to create the observer instance.
     *
     * @param \TechDivision\Import\Subjects\SubjectInterface $subject The subject instance
     *
     * @return \TechDivision\Import\Observers\ObserverInterface The observer instance
     */
Will be invoked by the observer visitor when a factory has been defined to create the observer instance.


Will be invoked by the observer visitor when a factory has been defined to create the observer instance .
public function createObserver(SubjectInterface $subject)
    {
        foreach ($this->observers as $key => $observer) {
            if ($observer instanceof ObserverFactoryInterface) {
                $observ = $observer->createObserver($subject);
                $observ->setSubject($subject);
                $this->observers[$key] = $observ;
            }
        }
        return $this;
    }
public function createObserver ( SubjectInterface $ subject ) { foreach ( $ this -> observers as $ key => $ observer ) { if ( $ observer instanceof ObserverFactoryInterface ) { $ observ = $ observer -> createObserver ( $ subject ) ; $ observ -> setSubject ( $ subject ) ; $ this -> observers [ $ key ] = $ observ ; } } return $ this ; }
Will be invoked by the observer visitor when a factory has been defined to create the observer instance.
Will be invoked by the observer visitor when a factory has been defined to create the observer instance .
// iterate over the observers to figure out which of them implements the factory intereface // query whether or not a factory has been specified // finally, return the composite observer instance