I have an idea about the nomencladores schema obtenerPaisesPorFabricanteProductoSolicitud . This is the content to represent:
SELECT ps.id AS psid, ps.nombre, fps.id AS fpsid FROM ( ( nomencladores.pais ps JOIN nomencladores.pais_fabricante_producto_solicitud pfps ON ((pfps.pais_id = ps.id)) ) JOIN negocio.fabricante_producto_solicitud fps ON ( ( pfps.fabricante_producto_solicitud_id = fps.id ) ) );
I am trying to display the view as follows:
use Doctrine\ORM\Mapping as ORM; class ObtenerPaisesPorFabricanteProductoSolicitud { protected $ps; protected $fps; protected $nombre; public function getPs() { return $this->ps; } public function getFps() { return $this->fps; } public function getNombre() { return $this->nombre; } }
But anytime I run this code on it:
$ent = $em->getRepository("AppBundle:ObtenerPaisesPorFabricanteProductoSolicitud")->findBy( array( "fps" => $entF->getId() ) );
I got this result:
An exception occurred while executing 'SELECT t0.psid AS psid1, t0.fpsid AS fpsid2, t0.nombre AS nombre3 FROM nomencladores.obtenerPaisesPorFabricanteProductoSolicitud t0 WHERE t0.fpsid =? 'with parameters [22]: SQLSTATE [42P01]: Undefined table: 7 ERROR: relation "nomencladores.obtenerpaisesporfabricanteproductosolicitud" does not exist LINE 1: ... d1, t0.fpsid AS fpsid2, t0.nombre AS nombre3 FROM nomenclado ...
If I remove the annotations then error conversion:
The class "AppBundle \ Entity \ ObtenerPaisesPorFabricanteProductoSolicitud" is not a valid entity or mapped superclass. "
Why is Doctrine2 or Symfony trying to execute the request, instead view the view? How can I perform a view from Symfony2 / Doctrine2?
EDIT
As a side note, I use PostgreSQL as a DB, and it has several squemas, in this case I wrote a view in nomencladores schemas, but I tried putting also in the public schema, and no one seems to work, apparently Doctrine doesn't find idea of ββthe scheme