public function attachSubject($event, \SplSubject $subject)
    {
        $key = $this->getUniqueKey($event);

        if (!array_key_exists($event, $this->subjects)) {
            $this->subjects[$event] = array();
        }

        $this->subjects[$event][$key] = $subject;

        return $key;
    }
public function attachSubject($event, \SplSubject $subject)
    {
        $key = $this->getUniqueKey($event);

        if (!array_key_exists($event, $this->subjects)) {
            $this->subjects[$event] = array();
        }

        $this->subjects[$event][$key] = $subject;

        return $key;
    }
public function attachSubject ( $ event , \ SplSubject $ subject ) { $ key = $ this -> getUniqueKey ( $ event ) ; if ( ! array_key_exists ( $ event , $ this -> subjects ) ) { $ this -> subjects [ $ event ] = array ( ) ; } $ this -> subjects [ $ event ] [ $ key ] = $ subject ; return $ key ; }
Registers a subject to be called an a specific event.

@param string $event
@param \SplSubject $subject

@return string
Registers a subject to be called an a specific event .