Код: Выделить всё
$records = Post::model()->with('author')->findAllByTags(array('yii');
Код: Выделить всё
$records = Post::model()->with('author')->findAllByTags(array('yii');
Код: Выделить всё
$conn = $this->owner->dbConnection;
Код: Выделить всё
/**
* Get all possible tags for current model class
*
* @param CDbCriteria $criteria
* @return array
*/
public function getAllTags($criteria = null){
if(!($tags = $this->cache->get('Taggable'.$this->getOwner()->tableName().'All'))){
// getting associated tags
$builder = $this->getOwner()->getCommandBuilder();
$criteria = new CDbCriteria(); // тут не учитывается, передан ли параметр
$criteria->select = 'name';
$tags = $builder->createFindCommand($this->tagTable, $criteria)->queryColumn();
$this->cache->set('Taggable'.$this->getOwner()->tableName().'All', $tags);
}
return $tags;
}