Elgg\Notifications\NotificationsService::unregisterEvent PHP Метод

unregisterEvent() публичный Метод

См. также: elgg_unregister_notification_event()
public unregisterEvent ( $type, $subtype )
    public function unregisterEvent($type, $subtype)
    {
        if (!isset($this->events[$type]) || !isset($this->events[$type][$subtype])) {
            return false;
        }
        unset($this->events[$type][$subtype]);
        return true;
    }

Usage Example

Пример #1
0
 public function testUnregisterEvent()
 {
     $this->setupServices();
     $object = $this->getTestObject();
     $this->notifications->registerEvent($object->getType(), $object->getSubtype());
     $this->assertTrue($this->notifications->unregisterEvent($object->getType(), $object->getSubtype()));
     $events = array($object->getType() => array());
     $this->assertEquals($events, $this->notifications->getEvents());
     $this->assertFalse($this->notifications->unregisterEvent($object->getType(), $object->getSubtype()));
 }