for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @author Nikola Kostadinov<[email protected]>
* Date: 02.08.2016
* Time: 09:11 ч.
*/
namespace nkostadinov\taxonomy\behaviors;
use nkostadinov\taxonomy\models\TaxonomyTerms;
class PropertyQueryBehavior extends BaseTermBehavior
{
public function hasProp($name, $value = null)
$this->joinTables();
if(!empty($name))
$this->getQuery()
->andFilterWhere([ TaxonomyTerms::tableName() . '.term' => $name ]);
if(!empty($value))
->andFilterWhere([ $this->taxonomy->table . '.value' => $value ]);
return $this->getQuery();
}