<?php /* * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many individuals * and is licensed under the MIT license. For more information, see * <http://www.doctrine-project.org>. */ namespace Doctrine\ORM; /** * Represents a native SQL query. * * @author Roman Borschel <roman@code-factory.org> * @since 2.0 */ final class NativeQuery extends AbstractQuery { /** * @var string */ private $_sql; /** * Sets the SQL of the query. * * @param string $sql * * @return self This query instance. */ public function setSQL($sql) : self { $this->_sql = $sql; return $this; } /** * Gets the SQL query. * * @return mixed The built SQL query or an array of all SQL queries. * * @override */ public function getSQL() { return $this->_sql; } /** * {@inheritdoc} */ protected function _doExecute() { $parameters = []; $types = []; foreach ($this->getParameters() as $parameter) { $name = $parameter->getName(); $value = $this->processParameterValue($parameter->getValue()); $type = ($parameter->getValue() === $value) ? $parameter->getType() : Query\ParameterTypeInferer::inferType($value); $parameters[$name] = $value; $types[$name] = $type; } if ($parameters && is_int(key($parameters))) { ksort($parameters); ksort($types); $parameters = array_values($parameters); $types = array_values($types); } return $this->_em->getConnection()->executeQuery( $this->_sql, $parameters, $types, $this->_queryCacheProfile ); } }
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
Cache | Folder | 0755 |
|
|
Decorator | Folder | 0755 |
|
|
Event | Folder | 0755 |
|
|
Id | Folder | 0755 |
|
|
Internal | Folder | 0755 |
|
|
Mapping | Folder | 0755 |
|
|
Persisters | Folder | 0755 |
|
|
Proxy | Folder | 0755 |
|
|
Query | Folder | 0755 |
|
|
Repository | Folder | 0755 |
|
|
Tools | Folder | 0755 |
|
|
Utility | Folder | 0755 |
|
|
AbstractQuery.php | File | 32.04 KB | 0644 |
|
Cache.php | File | 5.66 KB | 0644 |
|
Configuration.php | File | 27.28 KB | 0644 |
|
EntityManager.php | File | 27.89 KB | 0644 |
|
EntityManagerInterface.php | File | 8.65 KB | 0644 |
|
EntityNotFoundException.php | File | 1.65 KB | 0644 |
|
EntityRepository.php | File | 9.35 KB | 0644 |
|
Events.php | File | 5.28 KB | 0644 |
|
LazyCriteriaCollection.php | File | 3.78 KB | 0644 |
|
NativeQuery.php | File | 2.56 KB | 0644 |
|
NoResultException.php | File | 1.35 KB | 0644 |
|
NonUniqueResultException.php | File | 1.42 KB | 0644 |
|
ORMException.php | File | 9.66 KB | 0644 |
|
ORMInvalidArgumentException.php | File | 9.16 KB | 0644 |
|
OptimisticLockException.php | File | 2.9 KB | 0644 |
|
PersistentCollection.php | File | 20.78 KB | 0644 |
|
PessimisticLockException.php | File | 1.48 KB | 0644 |
|
Query.php | File | 21.32 KB | 0644 |
|
QueryBuilder.php | File | 41.38 KB | 0644 |
|
README.markdown | File | 0 B | 0644 |
|
TransactionRequiredException.php | File | 1.59 KB | 0644 |
|
UnexpectedResultException.php | File | 1.17 KB | 0644 |
|
UnitOfWork.php | File | 122.39 KB | 0644 |
|
Version.php | File | 2.03 KB | 0644 |
|