return new UniqueConstraintViolationException($exception, $query);
case 1054:
case 1166:
case 1611:
return new InvalidFieldNameException($exception, $query);
case 1052:
case 1060:
case 1110:
return new NonUniqueFieldNameException($exception, $query);
private function handleDriverException(
Driver\Exception $driverException,
?Query $query
): DriverException {
$this->exceptionConverter ??= $this->_driver->getExceptionConverter();
$exception = $this->exceptionConverter->convert($driverException, $query);
if ($exception instanceof ConnectionLost) {
$this->close();
}
Driver\Exception $e,
string $sql,
array $params = [],
array $types = []
): DriverException {
return $this->handleDriverException($e, new Query($sql, $params, $types));
}
/** @internal */
final public function convertException(Driver\Exception $e): DriverException
{
$result = $connection->query($sql);
}
return new Result($result, $this);
} catch (Driver\Exception $e) {
throw $this->convertExceptionDuringQuery($e, $sql, $params, $types);
} finally {
if ($logger !== null) {
$logger->stopQuery();
}
}
{
$this->switchPersisterContext(null, $limit);
$sql = $this->getSelectSQL($criteria, $assoc, $lockMode, $limit, null, $orderBy);
[$params, $types] = $this->expandParameters($criteria);
$stmt = $this->conn->executeQuery($sql, $params, $types);
if ($entity !== null) {
$hints[Query::HINT_REFRESH] = true;
$hints[Query::HINT_REFRESH_ENTITY] = $entity;
}
*/
public function findOneBy(array $criteria, ?array $orderBy = null)
{
$persister = $this->_em->getUnitOfWork()->getEntityPersister($this->_entityName);
return $persister->load($criteria, null, null, [], null, 1, $orderBy);
}
/**
* Counts entities by a set of criteria.
*
if ($this->getUser()) {
$cart->setUser($this->getUser());
}
$em = $this->getDoctrine()->getManager();
$product = $em->getRepository(Product::class)->findOneBy(['slug' => $slug]);
if (!$product) {
throw new NotFoundHttpException();
}
$this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);
$controller = $event->getController();
$arguments = $event->getArguments();
// call controller
$response = $controller(...$arguments);
// view
if (!$response instanceof Response) {
$event = new ViewEvent($this, $request, $type, $response);
$this->dispatcher->dispatch($event, KernelEvents::VIEW);
{
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
$this->requestStack->push($request);
try {
return $this->handleRaw($request, $type);
} catch (\Exception $e) {
if ($e instanceof RequestExceptionInterface) {
$e = new BadRequestHttpException($e->getMessage(), $e);
}
if (false === $catch) {
$this->boot();
++$this->requestStackSize;
$this->resetServices = true;
try {
return $this->getHttpKernel()->handle($request, $type, $catch);
} finally {
--$this->requestStackSize;
}
}
$this->request = $request;
}
public function run(): int
{
$response = $this->kernel->handle($this->request);
$response->send();
if ($this->kernel instanceof TerminableInterface) {
$this->kernel->terminate($this->request, $response);
}
$app = $app(...$args);
exit(
$runtime
->getRunner($app)
->run()
);
<?php
use App\Kernel;
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
return static function (array $context) {
return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
};
} else {
$code = $exception->getCode();
$sqlState = null;
}
return new self($exception->getMessage(), $sqlState, $code, $exception);
}
}
}
try {
$this->stmt->execute($params);
} catch (PDOException $exception) {
throw Exception::new($exception);
}
return new Result($this->stmt);
}
}
/**
* {@inheritDoc}
*/
public function execute($params = null): Result
{
return $this->wrappedStatement->execute($params);
}
}
'sql' => $this->sql,
'params' => $params ?? $this->params,
'types' => $this->types,
]);
return parent::execute($params);
}
}
/**
* {@inheritDoc}
*/
public function execute($params = null): Result
{
return $this->wrappedStatement->execute($params);
}
}
$this->stopwatch->start('doctrine', 'doctrine');
}
$query->start();
try {
return parent::execute($params);
} finally {
$query->stop();
if ($this->stopwatch) {
$this->stopwatch->stop('doctrine');
}
$stmt = $connection->prepare($sql);
$this->bindParameters($stmt, $params, $types);
$result = $stmt->execute();
} else {
$result = $connection->query($sql);
}
return new Result($result, $this);
{
$this->switchPersisterContext(null, $limit);
$sql = $this->getSelectSQL($criteria, $assoc, $lockMode, $limit, null, $orderBy);
[$params, $types] = $this->expandParameters($criteria);
$stmt = $this->conn->executeQuery($sql, $params, $types);
if ($entity !== null) {
$hints[Query::HINT_REFRESH] = true;
$hints[Query::HINT_REFRESH_ENTITY] = $entity;
}
*/
public function findOneBy(array $criteria, ?array $orderBy = null)
{
$persister = $this->_em->getUnitOfWork()->getEntityPersister($this->_entityName);
return $persister->load($criteria, null, null, [], null, 1, $orderBy);
}
/**
* Counts entities by a set of criteria.
*
if ($this->getUser()) {
$cart->setUser($this->getUser());
}
$em = $this->getDoctrine()->getManager();
$product = $em->getRepository(Product::class)->findOneBy(['slug' => $slug]);
if (!$product) {
throw new NotFoundHttpException();
}
$this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);
$controller = $event->getController();
$arguments = $event->getArguments();
// call controller
$response = $controller(...$arguments);
// view
if (!$response instanceof Response) {
$event = new ViewEvent($this, $request, $type, $response);
$this->dispatcher->dispatch($event, KernelEvents::VIEW);
{
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
$this->requestStack->push($request);
try {
return $this->handleRaw($request, $type);
} catch (\Exception $e) {
if ($e instanceof RequestExceptionInterface) {
$e = new BadRequestHttpException($e->getMessage(), $e);
}
if (false === $catch) {
$this->boot();
++$this->requestStackSize;
$this->resetServices = true;
try {
return $this->getHttpKernel()->handle($request, $type, $catch);
} finally {
--$this->requestStackSize;
}
}
$this->request = $request;
}
public function run(): int
{
$response = $this->kernel->handle($this->request);
$response->send();
if ($this->kernel instanceof TerminableInterface) {
$this->kernel->terminate($this->request, $response);
}
$app = $app(...$args);
exit(
$runtime
->getRunner($app)
->run()
);
<?php
use App\Kernel;
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
return static function (array $context) {
return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
};
. ' Statement::bindParam() or Statement::bindValue() instead.',
);
}
try {
$this->stmt->execute($params);
} catch (PDOException $exception) {
throw Exception::new($exception);
}
return new Result($this->stmt);
. ' Statement::bindParam() or Statement::bindValue() instead.',
);
}
try {
$this->stmt->execute($params);
} catch (PDOException $exception) {
throw Exception::new($exception);
}
return new Result($this->stmt);
/**
* {@inheritDoc}
*/
public function execute($params = null): Result
{
return $this->wrappedStatement->execute($params);
}
}
'sql' => $this->sql,
'params' => $params ?? $this->params,
'types' => $this->types,
]);
return parent::execute($params);
}
}
/**
* {@inheritDoc}
*/
public function execute($params = null): Result
{
return $this->wrappedStatement->execute($params);
}
}
$this->stopwatch->start('doctrine', 'doctrine');
}
$query->start();
try {
return parent::execute($params);
} finally {
$query->stop();
if ($this->stopwatch) {
$this->stopwatch->stop('doctrine');
}
$stmt = $connection->prepare($sql);
$this->bindParameters($stmt, $params, $types);
$result = $stmt->execute();
} else {
$result = $connection->query($sql);
}
return new Result($result, $this);
{
$this->switchPersisterContext(null, $limit);
$sql = $this->getSelectSQL($criteria, $assoc, $lockMode, $limit, null, $orderBy);
[$params, $types] = $this->expandParameters($criteria);
$stmt = $this->conn->executeQuery($sql, $params, $types);
if ($entity !== null) {
$hints[Query::HINT_REFRESH] = true;
$hints[Query::HINT_REFRESH_ENTITY] = $entity;
}
*/
public function findOneBy(array $criteria, ?array $orderBy = null)
{
$persister = $this->_em->getUnitOfWork()->getEntityPersister($this->_entityName);
return $persister->load($criteria, null, null, [], null, 1, $orderBy);
}
/**
* Counts entities by a set of criteria.
*
if ($this->getUser()) {
$cart->setUser($this->getUser());
}
$em = $this->getDoctrine()->getManager();
$product = $em->getRepository(Product::class)->findOneBy(['slug' => $slug]);
if (!$product) {
throw new NotFoundHttpException();
}
$this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);
$controller = $event->getController();
$arguments = $event->getArguments();
// call controller
$response = $controller(...$arguments);
// view
if (!$response instanceof Response) {
$event = new ViewEvent($this, $request, $type, $response);
$this->dispatcher->dispatch($event, KernelEvents::VIEW);
{
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
$this->requestStack->push($request);
try {
return $this->handleRaw($request, $type);
} catch (\Exception $e) {
if ($e instanceof RequestExceptionInterface) {
$e = new BadRequestHttpException($e->getMessage(), $e);
}
if (false === $catch) {
$this->boot();
++$this->requestStackSize;
$this->resetServices = true;
try {
return $this->getHttpKernel()->handle($request, $type, $catch);
} finally {
--$this->requestStackSize;
}
}
$this->request = $request;
}
public function run(): int
{
$response = $this->kernel->handle($this->request);
$response->send();
if ($this->kernel instanceof TerminableInterface) {
$this->kernel->terminate($this->request, $response);
}
$app = $app(...$args);
exit(
$runtime
->getRunner($app)
->run()
);
<?php
use App\Kernel;
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
return static function (array $context) {
return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
};
No log messages
[3/3]
InvalidFieldNameException
|
---|
Doctrine\DBAL\Exception\InvalidFieldNameException: An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.is_new' in 'field list' at vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php:67 at Doctrine\DBAL\Driver\API\MySQL\ExceptionConverter->convert(object(Exception), object(Query)) (vendor/doctrine/dbal/src/Connection.php:1938) at Doctrine\DBAL\Connection->handleDriverException(object(Exception), object(Query)) (vendor/doctrine/dbal/src/Connection.php:1880) at Doctrine\DBAL\Connection->convertExceptionDuringQuery(object(Exception), 'SELECT t0.id AS id_1, t0.name AS name_2, t0.slug AS slug_3, t0.short_description AS short_description_4, t0.long_description AS long_description_5, t0.is_bestseller AS is_bestseller_6, t0.is_new AS is_new_7, t0.position AS position_8, t0.created_at AS created_at_9, t0.updated_at AS updated_at_10, t0.category_id AS category_id_11 FROM product t0 WHERE t0.slug = ? LIMIT 1', array('kawa-aroma-dolce-1000g'), array('string')) (vendor/doctrine/dbal/src/Connection.php:1105) at Doctrine\DBAL\Connection->executeQuery('SELECT t0.id AS id_1, t0.name AS name_2, t0.slug AS slug_3, t0.short_description AS short_description_4, t0.long_description AS long_description_5, t0.is_bestseller AS is_bestseller_6, t0.is_new AS is_new_7, t0.position AS position_8, t0.created_at AS created_at_9, t0.updated_at AS updated_at_10, t0.category_id AS category_id_11 FROM product t0 WHERE t0.slug = ? LIMIT 1', array('kawa-aroma-dolce-1000g'), array('string')) (vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php:771) at Doctrine\ORM\Persisters\Entity\BasicEntityPersister->load(array('slug' => 'kawa-aroma-dolce-1000g'), null, null, array(), null, 1, null) (vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php:241) at Doctrine\ORM\EntityRepository->findOneBy(array('slug' => 'kawa-aroma-dolce-1000g')) (src/Controller/CartController.php:343) at App\Controller\CartController->addSingle(object(Request), 'kawa-aroma-dolce-1000g') (vendor/symfony/http-kernel/HttpKernel.php:163) at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1) (vendor/symfony/http-kernel/HttpKernel.php:75) at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true) (vendor/symfony/http-kernel/Kernel.php:202) at Symfony\Component\HttpKernel\Kernel->handle(object(Request)) (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35) at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run() (vendor/autoload_runtime.php:35) at require_once('/home/coffeeon/domains/venetto.pl/public_html/vendor/autoload_runtime.php') (public/index.php:5) |
[2/3]
Exception
|
---|
Doctrine\DBAL\Driver\PDO\Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.is_new' in 'field list' at vendor/doctrine/dbal/src/Driver/PDO/Exception.php:28 at Doctrine\DBAL\Driver\PDO\Exception::new(object(PDOException)) (vendor/doctrine/dbal/src/Driver/PDO/Statement.php:132) at Doctrine\DBAL\Driver\PDO\Statement->execute(null) (vendor/doctrine/dbal/src/Driver/Middleware/AbstractStatementMiddleware.php:69) at Doctrine\DBAL\Driver\Middleware\AbstractStatementMiddleware->execute(null) (vendor/doctrine/dbal/src/Logging/Statement.php:98) at Doctrine\DBAL\Logging\Statement->execute(null) (vendor/doctrine/dbal/src/Driver/Middleware/AbstractStatementMiddleware.php:69) at Doctrine\DBAL\Driver\Middleware\AbstractStatementMiddleware->execute(null) (vendor/symfony/doctrine-bridge/Middleware/Debug/DBAL3/Statement.php:78) at Symfony\Bridge\Doctrine\Middleware\Debug\DBAL3\Statement->execute() (vendor/doctrine/dbal/src/Connection.php:1098) at Doctrine\DBAL\Connection->executeQuery('SELECT t0.id AS id_1, t0.name AS name_2, t0.slug AS slug_3, t0.short_description AS short_description_4, t0.long_description AS long_description_5, t0.is_bestseller AS is_bestseller_6, t0.is_new AS is_new_7, t0.position AS position_8, t0.created_at AS created_at_9, t0.updated_at AS updated_at_10, t0.category_id AS category_id_11 FROM product t0 WHERE t0.slug = ? LIMIT 1', array('kawa-aroma-dolce-1000g'), array('string')) (vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php:771) at Doctrine\ORM\Persisters\Entity\BasicEntityPersister->load(array('slug' => 'kawa-aroma-dolce-1000g'), null, null, array(), null, 1, null) (vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php:241) at Doctrine\ORM\EntityRepository->findOneBy(array('slug' => 'kawa-aroma-dolce-1000g')) (src/Controller/CartController.php:343) at App\Controller\CartController->addSingle(object(Request), 'kawa-aroma-dolce-1000g') (vendor/symfony/http-kernel/HttpKernel.php:163) at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1) (vendor/symfony/http-kernel/HttpKernel.php:75) at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true) (vendor/symfony/http-kernel/Kernel.php:202) at Symfony\Component\HttpKernel\Kernel->handle(object(Request)) (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35) at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run() (vendor/autoload_runtime.php:35) at require_once('/home/coffeeon/domains/venetto.pl/public_html/vendor/autoload_runtime.php') (public/index.php:5) |
[1/3]
PDOException
|
---|
PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.is_new' in 'field list' at vendor/doctrine/dbal/src/Driver/PDO/Statement.php:130 at PDOStatement->execute(null) (vendor/doctrine/dbal/src/Driver/PDO/Statement.php:130) at Doctrine\DBAL\Driver\PDO\Statement->execute(null) (vendor/doctrine/dbal/src/Driver/Middleware/AbstractStatementMiddleware.php:69) at Doctrine\DBAL\Driver\Middleware\AbstractStatementMiddleware->execute(null) (vendor/doctrine/dbal/src/Logging/Statement.php:98) at Doctrine\DBAL\Logging\Statement->execute(null) (vendor/doctrine/dbal/src/Driver/Middleware/AbstractStatementMiddleware.php:69) at Doctrine\DBAL\Driver\Middleware\AbstractStatementMiddleware->execute(null) (vendor/symfony/doctrine-bridge/Middleware/Debug/DBAL3/Statement.php:78) at Symfony\Bridge\Doctrine\Middleware\Debug\DBAL3\Statement->execute() (vendor/doctrine/dbal/src/Connection.php:1098) at Doctrine\DBAL\Connection->executeQuery('SELECT t0.id AS id_1, t0.name AS name_2, t0.slug AS slug_3, t0.short_description AS short_description_4, t0.long_description AS long_description_5, t0.is_bestseller AS is_bestseller_6, t0.is_new AS is_new_7, t0.position AS position_8, t0.created_at AS created_at_9, t0.updated_at AS updated_at_10, t0.category_id AS category_id_11 FROM product t0 WHERE t0.slug = ? LIMIT 1', array('kawa-aroma-dolce-1000g'), array('string')) (vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php:771) at Doctrine\ORM\Persisters\Entity\BasicEntityPersister->load(array('slug' => 'kawa-aroma-dolce-1000g'), null, null, array(), null, 1, null) (vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php:241) at Doctrine\ORM\EntityRepository->findOneBy(array('slug' => 'kawa-aroma-dolce-1000g')) (src/Controller/CartController.php:343) at App\Controller\CartController->addSingle(object(Request), 'kawa-aroma-dolce-1000g') (vendor/symfony/http-kernel/HttpKernel.php:163) at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1) (vendor/symfony/http-kernel/HttpKernel.php:75) at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true) (vendor/symfony/http-kernel/Kernel.php:202) at Symfony\Component\HttpKernel\Kernel->handle(object(Request)) (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35) at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run() (vendor/autoload_runtime.php:35) at require_once('/home/coffeeon/domains/venetto.pl/public_html/vendor/autoload_runtime.php') (public/index.php:5) |