Term::setScopeForTaxonomy PHP Method

setScopeForTaxonomy() public method

Set Scope
public setScopeForTaxonomy ( integer $vocabularyId )
$vocabularyId integer Vocabulary Id
    public function setScopeForTaxonomy($vocabularyId)
    {
        $scopeSettings = array('scope' => array('Taxonomy.vocabulary_id' => $vocabularyId));
        if ($this->Vocabulary->Taxonomy->Behaviors->loaded('Tree')) {
            $this->Vocabulary->Taxonomy->Behaviors->Tree->setup($this->Vocabulary->Taxonomy, $scopeSettings);
        } else {
            $this->Vocabulary->Taxonomy->Behaviors->load('Tree', $scopeSettings);
        }
    }