src/Liip/Drupal/Modules/EventManager/SubjectFactory.php
public function initSubject($name)
    {
        $this->fetchSubjectsFromRegistry($name);

        try {

            if (empty($this->subjects[$name])) {
                $this->subjects[$name] = new EventSubject($name);

                if ($this->registry->isRegistered($name)) {

                    // modify registration
                    $this->registry->replace($name, $this->subjects[$name]);

                } else {

                    $this->registry->register($name, $this->subjects[$name]);
                }
            }

        } catch (RegistryException $re) {
            $this->getDrupalConnectorFactory()
                ->getCommonConnector()
                ->watchdog(
                'Liip Drupal Event Manager',
                $re->getMessage(),
                array(),
                WATCHDOG_ERROR
            );
        }
    }
public function initSubject($name)
    {
        $this->fetchSubjectsFromRegistry($name);

        try {

            if (empty($this->subjects[$name])) {
                $this->subjects[$name] = new EventSubject($name);

                if ($this->registry->isRegistered($name)) {

                    // modify registration
                    $this->registry->replace($name, $this->subjects[$name]);

                } else {

                    $this->registry->register($name, $this->subjects[$name]);
                }
            }

        } catch (RegistryException $re) {
            $this->getDrupalConnectorFactory()
                ->getCommonConnector()
                ->watchdog(
                'Liip Drupal Event Manager',
                $re->getMessage(),
                array(),
                WATCHDOG_ERROR
            );
        }
    }
public function initSubject ( $ name ) { $ this -> fetchSubjectsFromRegistry ( $ name ) ; try { if ( empty ( $ this -> subjects [ $ name ] ) ) { $ this -> subjects [ $ name ] = new EventSubject ( $ name ) ; if ( $ this -> registry -> isRegistered ( $ name ) ) { // modify registration $ this -> registry -> replace ( $ name , $ this -> subjects [ $ name ] ) ; } else { $ this -> registry -> register ( $ name , $ this -> subjects [ $ name ] ) ; } } } catch ( RegistryException $ re ) { $ this -> getDrupalConnectorFactory ( ) -> getCommonConnector ( ) -> watchdog ( 'Liip Drupal Event Manager' , $ re -> getMessage ( ) , array ( ) , WATCHDOG_ERROR ) ; } }
Initiates and caches an event subject for later use.

@param string $name
Initiates and caches an event subject for later use .