base/DictionaryManager.php
public function getSynonyms($class = null, $words = [])
    {
        // Method One:
        $query = Synonym::find();
        if (is_array($words) && !empty($words)) {
            $query = $query->word($words);
        }
        if (!($class === null || $class === false || (is_string($class) && empty($class)))) {
            $query = $query->extension($class);
        }
        foreach ($query->all() as $synonyms) {
            yield $synonyms;
        }
        // Method Two:
        //return Synonym::find()->all();
    }
public function getSynonyms($class = null, $words = [])
    {
        // Method One:
        $query = Synonym::find();
        if (is_array($words) && !empty($words)) {
            $query = $query->word($words);
        }
        if (!($class === null || $class === false || (is_string($class) && empty($class)))) {
            $query = $query->extension($class);
        }
        foreach ($query->all() as $synonyms) {
            yield $synonyms;
        }
        // Method Two:
        //return Synonym::find()->all();
    }
public function getSynonyms ( $ class = null , $ words = [ ] ) { // Method One: $ query = Synonym :: find ( ) ; if ( is_array ( $ words ) && ! empty ( $ words ) ) { $ query = $ query -> word ( $ words ) ; } if ( ! ( $ class === null || $ class === false || ( is_string ( $ class ) && empty ( $ class ) ) ) ) { $ query = $ query -> extension ( $ class ) ; } foreach ( $ query -> all ( ) as $ synonyms ) { yield $ synonyms ; } // Method Two: //return Synonym::find()->all(); }
Synonyms generator.
@param string|\rhoone\extension\Extension|\rhoone\models\Extension|mixed $class
`string` if extension class.
@param string[] $words
@throws InvalidParamException
Synonyms generator .