Doesn’t Doctrine ORM 2 have support for working with VIEWS?

Asked

Viewed 60 times

0

I created a View in the database and now I need to use it in the system, but I can not use it, because the Doctrine à recognizes as a table, the following error appears:

Type: Doctrine\DBAL\Driver\Mysqli\MysqliException
Message: Table 'empresa.view_usuario' doesn't exist
File: /var/www/projeto/sistema/third_party/composer/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php
Line: 94

I took the following steps:

  • I created the view in the database
  • I created the Entity as Readonly
  • I created the DAO and nothing worked always returns this error

Is there any way to use views on Doctrine ?

  • The mistake is saying that in Database empresa there is no table view_usuario

  • Yes, but this is not a table is a view, I looked for some examples on the internet and and tried to do the entity there, only that always gives this error, in case I wouldn’t need the entity just need to query the view and take the data.

  • But the table exists ? If it doesn’t exist it won’t work.

  • There is no view, there is a view. But there is no way I can query this view using Doctrine ?

1 answer

0


Sorry I had forgotten to put the view as readonly,after I put worked all beauty.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.