本文整理汇总了PHP中Doctrine_Query::andWhere方法的典型用法代码示例。如果您正苦于以下问题:PHP Doctrine_Query::andWhere方法的具体用法?PHP Doctrine_Query::andWhere怎么用?PHP Doctrine_Query::andWhere使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Doctrine_Query
的用法示例。
在下文中一共展示了Doctrine_Query::andWhere方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: retrieveBackendUuserList
/**
* Query for uuser list
* @param Doctrine_Query $q
* @return Doctrine_Query
*/
public function retrieveBackendUuserList(Doctrine_Query $q)
{
$rootAlias = $q->getRootAlias();
$q->leftJoin($rootAlias . '.BalanceUser bu');
$q->andWhere($rootAlias . '.utype=?', 'uuser');
$q->andWhere($rootAlias . '.password IS NOT NULL');
return $q;
}
示例2: addStatutColumnQuery
protected function addStatutColumnQuery(Doctrine_Query $query, $field, $value)
{
if ($value == 0) {
$query->andWhere($query->getRootAlias() . '.statut <> ?', $value);
}
if ($value != 0) {
$query->andWhere($query->getRootAlias() . '.statut = ?', $value);
}
}
示例3: addRangeQuery
public function addRangeQuery(Doctrine_Query $query, $field, $values)
{
$fieldName = $this->getFieldName($field);
if ($values['from']) {
$query->andWhere(sprintf('%s.%s >= ?', $query->getRootAlias(), $fieldName), $values['from']);
}
if ($values['to']) {
$query->andWhere(sprintf('%s.%s <= ?', $query->getRootAlias(), $fieldName), $values['to']);
}
}
示例4: addScheduledTimeColumnQuery
protected function addScheduledTimeColumnQuery(Doctrine_Query $query, $field, $values)
{
switch ($values) {
case 'from_now':
$query->andWhere('r.scheduled_time >= ?', date('Y-m-d'));
break;
case 'all':
break;
default:
$values = str_replace('.', '-', $values);
$day_start = date('Y-m-d', strtotime($values));
$day_end = date('Y-m-d 23:59', strtotime($values) + 24 * 60 * 60);
$query->andWhere("r.scheduled_time >= ? AND r.scheduled_time <= ?", array($day_start, $day_end));
break;
}
}
示例5: addClassificationColumnQuery
public function addClassificationColumnQuery(Doctrine_Query $query, $field, $values)
{
if ($values != "") {
$query->andWhere(" classification = ? ", $values);
}
return $query;
}
示例6: _setProgramFilterCallback
public function _setProgramFilterCallback(Doctrine_Query $query, $value)
{
if (!empty($value)) {
$query->andWhere('pI.program_id = ?', $value);
}
return $query;
}
示例7: addSymplistIndexColumnQuery
public function addSymplistIndexColumnQuery(Doctrine_Query $query, $field, $value)
{
if ($value) {
$query->andWhere('symplist_index IS NOT NULL');
}
return $query;
}
示例8: buildQuery
function buildQuery(Doctrine_Query $query)
{
if ($this->getValue('name')) {
$query->andWhere('name LIKE ?', '%' . $this->getValue('name') . '%');
}
return $query;
}
示例9: applyQueryToDoctrineQuery
/**
* Apply user restriction to doctrine query
* @param Doctrine_Query $query
*/
private function applyQueryToDoctrineQuery(Doctrine_Query $query)
{
if ($this->getQuery()) {
$queryVal = '%' . $this->getQuery() . '%';
$queryParams = array($queryVal, $queryVal, $queryVal, $queryVal);
$query->andWhere('(user_name LIKE ? OR user_firstname LIKE ?' . ' OR user_lastname LIKE ? OR user_email LIKE ?)', $queryParams);
}
}
示例10: applyQueryToDoctrineQuery
private function applyQueryToDoctrineQuery(Doctrine_Query $query)
{
if ($this->getQuery()) {
$searchQuery = '%' . $this->getQuery() . '%';
$searchParams = array($searchQuery, $searchQuery);
$query->andWhere('(role_name LIKE ? OR role_description LIKE ?)', $searchParams);
}
}
示例11: addIgNumColumnQuery
public function addIgNumColumnQuery(Doctrine_Query $query, $field, $values)
{
if ($values != "") {
$conn_MGR = Doctrine_Manager::connection();
$query->andWhere("ig_num_indexed like concat(fullToIndex(" . $conn_MGR->quote($values, 'string') . "), '%') ");
}
return $query;
}
示例12: filterScope
public function filterScope(Doctrine_Query $query, sfUser $user)
{
//@todo: fix this shit!!!!!
//this is very ugly
$eventFilter = Doctrine_Query::create()->from('FishEvent fe')->select('fe.id')->where("fe.location_id in (" . Doctrine::getTable('Location')->getVisibleLocationsQuery($user, "lc1")->select('lc1.id') . ")");
$profitFilter = Doctrine_Query::create()->from('Profit pr')->select('pr.id')->where("pr.location_id in (" . Doctrine::getTable('Location')->getVisibleLocationsQuery($user, "lc2")->select('lc2.id') . ")");
return $query->andWhere("c.location_id in (" . Doctrine::getTable('Location')->getVisibleLocationsQuery($user, "lc3")->select('lc3.id') . ") or c.location_id is null")->andWhere("c.profit_id in ({$profitFilter}) or c.profit_id is null")->andWhere("c.fish_event_id in ({$eventFilter}) or c.fish_event_id is null");
}
示例13: addCallerIdColumnQuery
public function addCallerIdColumnQuery(Doctrine_Query $query, $field, $values)
{
if ($values != "") {
$alias = $query->getRootAlias();
$query->andWhere($alias . '.id != ?', $values);
}
return $query;
}
示例14: retrieveAdminChargeList
public function retrieveAdminChargeList(Doctrine_Query $q)
{
$rootAlias = $q->getRootAlias();
$q->leftJoin($rootAlias . '.Category ct');
$q->leftJoin($rootAlias . '.Vehicle v');
$q->andWhere('v.is_archived = ?', false);
return $q;
}
示例15: addVisiteurIdColumnQuery
public function addVisiteurIdColumnQuery(Doctrine_Query $query, $field, $value)
{
//Pour le xxxx tu peux utiliser $query->getRootAlias() pour récupérer l'alias racine de ta requete
if ($value['text']) {
$query->leftjoin($query->getRootAlias() . ".Visiteur v");
$query->andWhere('v.pseudo_son like ?', "%" . $value['text'] . "%");
}
}