This results in the following error:
Catchable Fatal Error: Object of class App\Entity\Gender could not be converted to string
So as workaround I could add the __toString method to the entity but unfortunately it does not solve the problem so that this column is also orderable.
Now I can see the table loading but if I try to order the table I'm getting the following error message:
octrine\ORM\Query\QueryException:
[Syntax Error] line 0, col -1: Error: Expected Doctrine\ORM\Query\Lexer::T_IDENTIFIER, got end of string.
at vendor/doctrine/orm/lib/Doctrine/ORM/Query/QueryException.php:54
at Doctrine\ORM\Query\QueryException::syntaxError('line 0, col -1: Error: Expected Doctrine\ORM\Query\Lexer::T_IDENTIFIER, got end of string.', object(QueryException))
(vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php:457)
at Doctrine\ORM\Query\Parser->syntaxError('Doctrine\ORM\Query\Lexer::T_IDENTIFIER')
(vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php:325)
at Doctrine\ORM\Query\Parser->match(102)
(vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php:1022)
at Doctrine\ORM\Query\Parser->ResultVariable()
(vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php:1521)
at Doctrine\ORM\Query\Parser->OrderByItem()
(vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php:1408)
at Doctrine\ORM\Query\Parser->OrderByClause()
(vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php:884)
at Doctrine\ORM\Query\Parser->SelectStatement()
(vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php:848)
at Doctrine\ORM\Query\Parser->QueryLanguage()
(vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php:261)
at Doctrine\ORM\Query\Parser->getAST()
(vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php:360)
at Doctrine\ORM\Query\Parser->parse()
(vendor/doctrine/orm/lib/Doctrine/ORM/Query.php:286)
at Doctrine\ORM\Query->_parse()
(vendor/doctrine/orm/lib/Doctrine/ORM/Query.php:234)
at Doctrine\ORM\Query->getResultSetMapping()
(vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php:902)
at Doctrine\ORM\AbstractQuery->iterate(array(), 1)
(vendor/doctrine/orm/lib/Doctrine/ORM/Query.php:689)
at Doctrine\ORM\Query->iterate(array(), 1)
(vendor/omines/datatables-bundle/src/Adapter/Doctrine/ORMAdapter.php:205)
at Omines\DataTablesBundle\Adapter\Doctrine\ORMAdapter->getResults(object(Query))
(vendor/omines/datatables-bundle/src/Adapter/AbstractAdapter.php:51)
at Omines\DataTablesBundle\Adapter\AbstractAdapter->getData(object(DataTableState))
(vendor/omines/datatables-bundle/src/DataTable.php:372)
at Omines\DataTablesBundle\DataTable->getResultSet()
(vendor/omines/datatables-bundle/src/DataTable.php:331)
at Omines\DataTablesBundle\DataTable->getResponse()
(src/Controller/UsersController.php:100)
at App\Controller\UsersController->getUsers(object(Request))
(vendor/symfony/http-kernel/HttpKernel.php:151)
at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
(vendor/symfony/http-kernel/HttpKernel.php:68)
at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
(vendor/symfony/http-kernel/Kernel.php:198)
at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
(public/index.php:24)
So I have an Entity "User" and this has a relation to the entity "personalData" - in addition "personalData" has a relation to "gender"
--> I want to have the gender data displayed in the datatables and keep the order and search functionalities working
Hi there,
I tried to get this working:
This results in the following error: Catchable Fatal Error: Object of class App\Entity\Gender could not be converted to string
So as workaround I could add the __toString method to the entity but unfortunately it does not solve the problem so that this column is also orderable.
Then I tried this approach:
Now I can see the table loading but if I try to order the table I'm getting the following error message: octrine\ORM\Query\QueryException: [Syntax Error] line 0, col -1: Error: Expected Doctrine\ORM\Query\Lexer::T_IDENTIFIER, got end of string.
at vendor/doctrine/orm/lib/Doctrine/ORM/Query/QueryException.php:54 at Doctrine\ORM\Query\QueryException::syntaxError('line 0, col -1: Error: Expected Doctrine\ORM\Query\Lexer::T_IDENTIFIER, got end of string.', object(QueryException)) (vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php:457) at Doctrine\ORM\Query\Parser->syntaxError('Doctrine\ORM\Query\Lexer::T_IDENTIFIER') (vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php:325) at Doctrine\ORM\Query\Parser->match(102) (vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php:1022) at Doctrine\ORM\Query\Parser->ResultVariable() (vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php:1521) at Doctrine\ORM\Query\Parser->OrderByItem() (vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php:1408) at Doctrine\ORM\Query\Parser->OrderByClause() (vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php:884) at Doctrine\ORM\Query\Parser->SelectStatement() (vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php:848) at Doctrine\ORM\Query\Parser->QueryLanguage() (vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php:261) at Doctrine\ORM\Query\Parser->getAST() (vendor/doctrine/orm/lib/Doctrine/ORM/Query/Parser.php:360) at Doctrine\ORM\Query\Parser->parse() (vendor/doctrine/orm/lib/Doctrine/ORM/Query.php:286) at Doctrine\ORM\Query->_parse() (vendor/doctrine/orm/lib/Doctrine/ORM/Query.php:234) at Doctrine\ORM\Query->getResultSetMapping() (vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php:902) at Doctrine\ORM\AbstractQuery->iterate(array(), 1) (vendor/doctrine/orm/lib/Doctrine/ORM/Query.php:689) at Doctrine\ORM\Query->iterate(array(), 1) (vendor/omines/datatables-bundle/src/Adapter/Doctrine/ORMAdapter.php:205) at Omines\DataTablesBundle\Adapter\Doctrine\ORMAdapter->getResults(object(Query)) (vendor/omines/datatables-bundle/src/Adapter/AbstractAdapter.php:51) at Omines\DataTablesBundle\Adapter\AbstractAdapter->getData(object(DataTableState)) (vendor/omines/datatables-bundle/src/DataTable.php:372) at Omines\DataTablesBundle\DataTable->getResultSet() (vendor/omines/datatables-bundle/src/DataTable.php:331) at Omines\DataTablesBundle\DataTable->getResponse() (src/Controller/UsersController.php:100) at App\Controller\UsersController->getUsers(object(Request)) (vendor/symfony/http-kernel/HttpKernel.php:151) at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1) (vendor/symfony/http-kernel/HttpKernel.php:68) at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true) (vendor/symfony/http-kernel/Kernel.php:198) at Symfony\Component\HttpKernel\Kernel->handle(object(Request)) (public/index.php:24)
So I have an Entity "User" and this has a relation to the entity "personalData" - in addition "personalData" has a relation to "gender" --> I want to have the gender data displayed in the datatables and keep the order and search functionalities working
Is there any workaround or is this a bug?