public function apply(DataQuery $query) { if (!is_array($this->getValue())) { $values = explode(',', $this->getValue()); } else { $values = $this->getValue(); } $filter = new ExactMatchFilter($this->getFullName(), $values, $this->getModifiers()); return $filter->apply($query); }
function testSelectWithPredicateFilters() { $query = new SQLQuery(); $query->select(array("Name"))->from("SQLQueryTest_DO"); $match = new ExactMatchFilter("Name", "Value"); $match->setModel('SQLQueryTest_DO'); $match->apply($query); $match = new PartialMatchFilter("Meta", "Value"); $match->setModel('SQLQueryTest_DO'); $match->apply($query); $this->assertEquals("SELECT Name FROM SQLQueryTest_DO WHERE (`SQLQueryTest_DO`.`Name` = 'Value') AND (`SQLQueryTest_DO`.`Meta` LIKE '%Value%')", $query->sql()); }
public function apply(DataQuery $query) { $filter = new ExactMatchFilter($this->getFullName(), $this->getValue(), $this->getModifiers()); return $filter->apply($query); }