public function deleteWithChildren()
    {
        $ids = array();

        $children = $this->getChildren()->toArray();

        array_walk_recursive($children, function($i, $k) use (&$ids) { if ($k == 'id') $ids[] = $i; });

        foreach ($ids as $id)
        {
            $this->destroy($id);
        }
    }
public function deleteWithChildren()
    {
        $ids = array();

        $children = $this->getChildren()->toArray();

        array_walk_recursive($children, function($i, $k) use (&$ids) { if ($k == 'id') $ids[] = $i; });

        foreach ($ids as $id)
        {
            $this->destroy($id);
        }
    }
public function deleteWithChildren ( ) { $ ids = array ( ) ; $ children = $ this -> getChildren ( ) -> toArray ( ) ; array_walk_recursive ( $ children , function ( $ i , $ k ) use ( & $ ids ) { if ( $ k == 'id' ) $ ids [ ] = $ i ; } ) ; foreach ( $ ids as $ id ) { $ this -> destroy ( $ id ) ; } }
Delete category with all children.

@return object
Delete category with all children .