public function testAppendPsToAddsClauseWithoutBindingForNullValues() { $cton = new BasicModelCriterion(new Criteria(), 'A.COL IS NULL', 'A.COL', null); $params = array(); $ps = ''; $cton->appendPsTo($ps, $params); $this->assertEquals('A.COL IS NULL', $ps); $this->assertEquals(array(), $params); }
/** * Appends a Prepared Statement representation of the ModelCriterion onto the buffer * Handles case insensitivity for VARCHAR columns * * @param string &$sb The string that will receive the Prepared Statement * @param array $params A list to which Prepared Statement parameters will be appended */ protected function appendPsForUniqueClauseTo(&$sb, array &$params) { // LIKE is case insensitive in mySQL and SQLite, but not in PostGres // If the column is case insensitive, use ILIKE / NOT ILIKE instead of LIKE / NOT LIKE if ($this->ignoreStringCase) { if ($this->getAdapter() instanceof PgsqlAdapter) { $this->clause = preg_replace('/LIKE \\?$/i', 'ILIKE ?', $this->clause); } else { throw new InvalidClauseException('Case insensitive LIKE is only supported in PostreSQL'); } } parent::appendPsForUniqueClauseTo($sb, $params); }