public function detach()
    {
        $em = $this->getEventsManager();

        if (!empty($this->space)) {
            foreach ($this->space as $space) {
                $em->detach($space, $this);
            }
        }

        foreach ($this->closures as $event => $closure) {
            $em->detach($event, $closure);
        }

        $this->closures = [];
    }
public function detach()
    {
        $em = $this->getEventsManager();

        if (!empty($this->space)) {
            foreach ($this->space as $space) {
                $em->detach($space, $this);
            }
        }

        foreach ($this->closures as $event => $closure) {
            $em->detach($event, $closure);
        }

        $this->closures = [];
    }
public function detach ( ) { $ em = $ this -> getEventsManager ( ) ; if ( ! empty ( $ this -> space ) ) { foreach ( $ this -> space as $ space ) { $ em -> detach ( $ space , $ this ) ; } } foreach ( $ this -> closures as $ event => $ closure ) { $ em -> detach ( $ event , $ closure ) ; } $ this -> closures = [ ] ; }
Detach all event attached to the EventsManager
Detach all event attached to the EventsManager