本文整理匯總了PHP中Doctrine_Query::andWhereLike方法的典型用法代碼示例。如果您正苦於以下問題:PHP Doctrine_Query::andWhereLike方法的具體用法?PHP Doctrine_Query::andWhereLike怎麽用?PHP Doctrine_Query::andWhereLike使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Doctrine_Query
的用法示例。
在下文中一共展示了Doctrine_Query::andWhereLike方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: addNameColumnQuery
protected function addNameColumnQuery(Doctrine_Query $query, $value)
{
if (!empty($value)) {
if (is_array($value)) {
foreach ($value as $v) {
$query->andWhereLike('name', $v);
}
} else {
if (!empty($value)) {
$query->andWhereLike('name', $values);
}
}
}
}
示例2: addNameColumnQuery
protected function addNameColumnQuery(Doctrine_Query $query, $field, $values)
{
$fieldName = $this->getFieldName($field);
if (is_array($values)) {
foreach ($values as $value) {
$query->andWhereLike('r.' . $fieldName, $value);
}
}
}
示例3: filterSearchQuery
public static function filterSearchQuery($q, $column, $value, $field)
{
$field = self::arrayKeyCamelize($field);
if (!$q) {
$q = new Doctrine_Query();
}
if (empty($value)) {
return $q;
}
switch ($field['FormType']) {
// selection
case 'checkbox':
case 'select':
case 'radio':
$q->andWhere($column . ' = ?', $value);
break;
case 'date':
$q->andWhere($column . ' LIKE ?', $value);
break;
// doesn't allow searching
// doesn't allow searching
case 'increased_input':
case 'language_select':
case 'password':
break;
case 'country_select':
case 'region_select':
$q->andWhere($column . ' = ?', $value);
break;
// text and something else
// text and something else
default:
$q->andWhereLike($column, $value);
break;
}
return $q;
}