public function relatedByCategoryValues($values, $attribute = null)
    {
        return $this->anyCategoryValues($values, $attribute)->addOrderBy(new Expression('COUNT(*) DESC'));
    }
public function relatedByCategoryValues($values, $attribute = null)
    {
        return $this->anyCategoryValues($values, $attribute)->addOrderBy(new Expression('COUNT(*) DESC'));
    }
public function relatedByCategoryValues ( $ values , $ attribute = null ) { return $ this -> anyCategoryValues ( $ values , $ attribute ) -> addOrderBy ( new Expression ( 'COUNT(*) DESC' ) ) ; }
Gets entities related by categories.
@param string|string[] $values
@param string|null $attribute
@return \yii\db\ActiveQuery the owner
Gets entities related by categories .