public function remove()
    {
        if($moduleEvents = $this->module->events())
        {
            $systemEvents = $this->load();
            if (isset($moduleEvents['listen']))
                // for listen event we must check if exists merge if not add it
                foreach ($moduleEvents['listen'] as $event => $listens)
                {
                    if (isset($systemEvents['listen'][$event]))
                    {
                        foreach ($listens as $listen)
                        {
                            $key = array_search($listen, $systemEvents['listen'][$event]);
                            if ($key !== false)
                                unset($listen, $systemEvents['listen'][$event][$key]);
                        }
                    }
                }
            // for subscribe
            if (isset($moduleEvents['subscribe']))
            {
                $key = array_search($moduleEvents['subscribe'], $systemEvents['subscribe'][$event]);
                if($key !==false)
                    unset($systemEvents['subscribe'][$key]);
            }
            return $this->set($systemEvents);
        }
        return true;
    }
public function remove()
    {
        if($moduleEvents = $this->module->events())
        {
            $systemEvents = $this->load();
            if (isset($moduleEvents['listen']))
                // for listen event we must check if exists merge if not add it
                foreach ($moduleEvents['listen'] as $event => $listens)
                {
                    if (isset($systemEvents['listen'][$event]))
                    {
                        foreach ($listens as $listen)
                        {
                            $key = array_search($listen, $systemEvents['listen'][$event]);
                            if ($key !== false)
                                unset($listen, $systemEvents['listen'][$event][$key]);
                        }
                    }
                }
            // for subscribe
            if (isset($moduleEvents['subscribe']))
            {
                $key = array_search($moduleEvents['subscribe'], $systemEvents['subscribe'][$event]);
                if($key !==false)
                    unset($systemEvents['subscribe'][$key]);
            }
            return $this->set($systemEvents);
        }
        return true;
    }
public function remove ( ) { if ( $ moduleEvents = $ this -> module -> events ( ) ) { $ systemEvents = $ this -> load ( ) ; if ( isset ( $ moduleEvents [ 'listen' ] ) ) // for listen event we must check if exists merge if not add it foreach ( $ moduleEvents [ 'listen' ] as $ event => $ listens ) { if ( isset ( $ systemEvents [ 'listen' ] [ $ event ] ) ) { foreach ( $ listens as $ listen ) { $ key = array_search ( $ listen , $ systemEvents [ 'listen' ] [ $ event ] ) ; if ( $ key !== false ) unset ( $ listen , $ systemEvents [ 'listen' ] [ $ event ] [ $ key ] ) ; } } } // for subscribe if ( isset ( $ moduleEvents [ 'subscribe' ] ) ) { $ key = array_search ( $ moduleEvents [ 'subscribe' ] , $ systemEvents [ 'subscribe' ] [ $ event ] ) ; if ( $ key !== false ) unset ( $ systemEvents [ 'subscribe' ] [ $ key ] ) ; } return $ this -> set ( $ systemEvents ) ; } return true ; }
remove events from system
remove events from system