/** * Returns the generated where-clause. * * The Where-clause is wrapped inside a group so it can be safely used * with other conditions. * * @param string $prependQuery Prepends this string to the where-clause * (" WHERE " or " AND " for example) * * @return string */ public function getWhereClause($prependQuery = '') { if (null === $this->whereClause) { $fields = $this->fieldsConfig->getFields(true); $connection = $this->entityManager->getConnection(); $queryGenerator = new QueryGenerator($this->entityManager->getConnection(), $this->getQueryPlatform($connection, $fields), $fields); $this->whereClause = $queryGenerator->getGroupQuery($this->searchCondition->getValuesGroup()); } if ('' !== $this->whereClause) { return $prependQuery . $this->whereClause; } return ''; }
/** * Returns the generated where-clause. * * The Where-clause is wrapped inside a group so it can be safely used * with other conditions. * * For SQL conversions to work properly you need to set the required * hints using getQueryHintName() and getQueryHintValue(). * * @param string $prependQuery Prepends this string to the where-clause * (" WHERE " or " AND " for example) * * @return string */ public function getWhereClause($prependQuery = '') { if (null === $this->whereClause) { $fields = $this->fieldsConfig->getFields(); $platform = new DqlQueryPlatform($this->entityManager, $fields); $queryGenerator = new QueryGenerator($this->entityManager->getConnection(), $platform, $fields); $this->nativePlatform = $this->getQueryPlatform($this->entityManager->getConnection(), $fields); $this->whereClause = $queryGenerator->getGroupQuery($this->searchCondition->getValuesGroup()); $this->parameters = $platform->getEmbeddedValues(); } if ('' !== $this->whereClause) { return $prependQuery . $this->whereClause; } return ''; }
/** * Returns the generated where-clause. * * The Where-clause is wrapped inside a group so it * can be safely used with other conditions. * * Values are embedded with in the Query. * * @param string $prependQuery Prepends this string to the where-clause * (" WHERE " or " AND " for example) * * @return string */ public function getWhereClause($prependQuery = '') { if (null === $this->whereClause) { $fields = $this->processFields(); $queryGenerator = new QueryGenerator($this->connection, $this->getQueryPlatform($fields), $fields); $this->whereClause = $queryGenerator->getGroupQuery($this->searchCondition->getValuesGroup()); } if ('' !== $this->whereClause) { return $prependQuery . $this->whereClause; } return ''; }