public function delete($slug)
    {
        if(is_object($slug) && $slug instanceof ModelObject)
            $slug = $slug->Slug;

        $this->Events->trigger(get_class($this).'.delete.pre', $this, $slug);
        $this->Events->trigger('AbstractSystemXMLDAO.delete.pre', $this, $slug);

        $this->loadSource();

        if(isset($this->objectsBySlug[$slug]))
        {
            $obj = $this->objectsBySlug[$slug];

            unset($this->objectsBySlug[$slug]);
            unset($this->slugsByID[$obj->AspectID]);

            $pKey = array_search($slug, $this->slugsByPluginID[$obj->PluginID]);
            unset($this->slugsByPluginID[$pKey]);

        }

        $this->persistSource();

        $this->Events->trigger(get_class($this).'.delete.post', $this, $slug);
        $this->Events->trigger('AbstractSystemXMLDAO.delete.post', $this, $slug);

        return true;
    }
public function delete($slug)
    {
        if(is_object($slug) && $slug instanceof ModelObject)
            $slug = $slug->Slug;

        $this->Events->trigger(get_class($this).'.delete.pre', $this, $slug);
        $this->Events->trigger('AbstractSystemXMLDAO.delete.pre', $this, $slug);

        $this->loadSource();

        if(isset($this->objectsBySlug[$slug]))
        {
            $obj = $this->objectsBySlug[$slug];

            unset($this->objectsBySlug[$slug]);
            unset($this->slugsByID[$obj->AspectID]);

            $pKey = array_search($slug, $this->slugsByPluginID[$obj->PluginID]);
            unset($this->slugsByPluginID[$pKey]);

        }

        $this->persistSource();

        $this->Events->trigger(get_class($this).'.delete.post', $this, $slug);
        $this->Events->trigger('AbstractSystemXMLDAO.delete.post', $this, $slug);

        return true;
    }
public function delete ( $ slug ) { if ( is_object ( $ slug ) && $ slug instanceof ModelObject ) $ slug = $ slug -> Slug ; $ this -> Events -> trigger ( get_class ( $ this ) . '.delete.pre' , $ this , $ slug ) ; $ this -> Events -> trigger ( 'AbstractSystemXMLDAO.delete.pre' , $ this , $ slug ) ; $ this -> loadSource ( ) ; if ( isset ( $ this -> objectsBySlug [ $ slug ] ) ) { $ obj = $ this -> objectsBySlug [ $ slug ] ; unset ( $ this -> objectsBySlug [ $ slug ] ) ; unset ( $ this -> slugsByID [ $ obj -> AspectID ] ) ; $ pKey = array_search ( $ slug , $ this -> slugsByPluginID [ $ obj -> PluginID ] ) ; unset ( $ this -> slugsByPluginID [ $ pKey ] ) ; } $ this -> persistSource ( ) ; $ this -> Events -> trigger ( get_class ( $ this ) . '.delete.post' , $ this , $ slug ) ; $ this -> Events -> trigger ( 'AbstractSystemXMLDAO.delete.post' , $ this , $ slug ) ; return true ; }
Removes the aspect and all the aspect relations

@param string $slug The slug of the aspect to remove

@return void
Removes the aspect and all the aspect relations