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();
        }
    }