I'm really confused. I use Symfony 2.7 and doctrine as my own ORM. This way everything works the way it should work when I run it using app_dev.php, but when I run it using app.php.
It just doesn't work. The magazines say:
[2017-11-27 09:02:51] request.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\DBALException: "An exception occurred while executing 'SELECT t1.id AS id2, t1.code AS code3, t1.created AS created4, t1.updated AS updated5, t1.template_code AS template_code6, t1.label_attribute_id AS label_attribute_id7 FROM pim_catalog_family t1 WHERE t0.code = ? LIMIT 1' with params ["city_actions"]: SQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.code' in 'where clause'" at /var/www/html/pim-community-standard/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php line 91 {"exception":"[object] (Doctrine\\DBAL\\DBALException(code: 0): An exception occurred while executing 'SELECT t1.id AS id2, t1.code AS code3, t1.created AS created4, t1.updated AS updated5, t1.template_code AS template_code6, t1.label_attribute_id AS label_attribute_id7 FROM pim_catalog_family t1 WHERE t0.code = ? LIMIT 1' with params [\"city_actions\"]:\n\nSQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.code' in 'where clause' at /var/www/html/pim-community-standard/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:91, PDOException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.code' in 'where clause' at /var/www/html/pim-community-standard/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:694)"} []
This is truly explicable, so it cannot find t0 because it does not exist. I already tried to clear the cache for the doctrine and clear the general cache of the application, but nothing works. I used these commands -
php app/console doctrine:cache:clear-metadata
php app/console doctrine:cache:clear-query
php app/console doctrine:cache:clear-result
php app/console cache:clear
Does anyone know what is going on here?
Edit:
<?php
namespace Iclei\Bundle\BackendBundle\Entity;
use Pim\Bundle\CatalogBundle\Entity\Family as BaseFamily;
class Family extends BaseFamily
{
protected $template_code;
public function getTemplateCode()
{
return $this->template_code;
}
public function setTemplateCode($template_code)
{
$this->template_code = $template_code;
}
}
And this is my family.orm.yml
Bundle\BackendBundle\Entity\Family:
type: entity
table: pim_catalog_family
changeTrackingPolicy: DEFERRED_EXPLICIT
repositoryClass: Pim\Bundle\CatalogBundle\Doctrine\ORM\Repository\FamilyRepository
uniqueConstraints:
pim_category_code_uc:
columns:
- code
fields:
template_code:
type: text
nullable: true