Exemplo n.º 1
0
 /**
  * Receives notification from plugin manager and processes it.
  * 
  * @param SubjectInterface $lms_plugin_manager Plugin manager
  */
 public function receiveUpdate(SubjectInterface $lms_plugin_manager)
 {
     $hook_name = $lms_plugin_manager->getHookName();
     $hook_data = $lms_plugin_manager->getHookData();
     $new_hook_data = $this->dispatcher($hook_name, $hook_data);
     $lms_plugin_manager->setHookData($new_hook_data);
 }
Exemplo n.º 2
0
 /**
  * {@inheritDoc}
  */
 public function receiveUpdate(SubjectInterface $subject)
 {
     $this->order = self::$counter++;
     $this->subject = $subject;
     if ($this->double) {
         $subject->notifyObservers();
     }
     if ($this->test) {
         $this->test->assertTrue(Property::get($subject, 'updating'), 'The subject should be updating.');
     }
     if ($this->interrupt) {
         $this->reason = new ReasonException('Testing interruption.');
         $subject->interruptUpdate($this->reason);
     }
 }
Exemplo n.º 3
0
 /**
  * {@inheritDoc}
  */
 public function replaceObservers(SubjectInterface $subject)
 {
     $this->observers = $subject->getObservers();
 }