public function updateDepth()
    {
        $parentTag = $this->getParent( true );
        $depth = $parentTag instanceof self ? $parentTag->attribute( 'depth' ) + 1 : 1;

        $this->setAttribute( 'depth', $depth );
        $this->store();

        foreach ( $this->getSynonyms( true ) as $s )
        {
            $s->setAttribute( 'depth', $depth );
            $s->store();
        }

        foreach ( $this->getChildren( 0, null, true ) as $c )
        {
            $c->updateDepth();
        }
    }
public function updateDepth()
    {
        $parentTag = $this->getParent( true );
        $depth = $parentTag instanceof self ? $parentTag->attribute( 'depth' ) + 1 : 1;

        $this->setAttribute( 'depth', $depth );
        $this->store();

        foreach ( $this->getSynonyms( true ) as $s )
        {
            $s->setAttribute( 'depth', $depth );
            $s->store();
        }

        foreach ( $this->getChildren( 0, null, true ) as $c )
        {
            $c->updateDepth();
        }
    }
public function updateDepth ( ) { $ parentTag = $ this -> getParent ( true ) ; $ depth = $ parentTag instanceof self ? $ parentTag -> attribute ( 'depth' ) + 1 : 1 ; $ this -> setAttribute ( 'depth' , $ depth ) ; $ this -> store ( ) ; foreach ( $ this -> getSynonyms ( true ) as $ s ) { $ s -> setAttribute ( 'depth' , $ depth ) ; $ s -> store ( ) ; } foreach ( $ this -> getChildren ( 0 , null , true ) as $ c ) { $ c -> updateDepth ( ) ; } }
Updates depth of the tag and all of it's children and synonyms.
Updates depth of the tag and all of it s children and synonyms .