models/SynonymQuery.php
public function headword($headword)
    {
        if ($headword instanceof Headword) {
            return $this->andWhere(['headword_guid' => $headword->guid]);
        }
        if (is_string($headword)) {
            $headword = Headword::find()->where(['word' => $headword])->one();
            if (!$headword) {
                return $this;
            }
            return $this->andWhere(['headword_guid' => $headword->guid]);
        }
    }
public function headword($headword)
    {
        if ($headword instanceof Headword) {
            return $this->andWhere(['headword_guid' => $headword->guid]);
        }
        if (is_string($headword)) {
            $headword = Headword::find()->where(['word' => $headword])->one();
            if (!$headword) {
                return $this;
            }
            return $this->andWhere(['headword_guid' => $headword->guid]);
        }
    }
public function headword ( $ headword ) { if ( $ headword instanceof Headword ) { return $ this -> andWhere ( [ 'headword_guid' => $ headword -> guid ] ) ; } if ( is_string ( $ headword ) ) { $ headword = Headword :: find ( ) -> where ( [ 'word' => $ headword ] ) -> one ( ) ; if ( ! $ headword ) { return $ this ; } return $ this -> andWhere ( [ 'headword_guid' => $ headword -> guid ] ) ; } }
Attach headword.
@param string|Headword $headword
@return \static
Attach headword .