Solution:
I found out, that doctrine really has nothing to offer for this use case.
I have to filter all "operator" characters on $searchTerm myself.
I do this with:
```
$searchTerm = '*' . preg_replace('/[+\-> ...
Hey Ed,
You might be interested to look at implementation of Paginator in Symfony Demo that is based on Doctrine paginator :)
https://github.com/symfony/demo/blob/d94fcc81f81a72760a4ed759579afaf727d538f2/src/Pagination/Paginator.php
Cheers! ...
actually what I did was install the Doctrine Test Bundle and it also refreshes the db after every test. Found here https://symfony.com/doc/current/testing/database.html#resetting-the-database-automatically-before-each-test ...
Hey Dung L.
You only have to tweak your ORM config. It should use the "underscore" naming strategy instead of camel case.
```
// config/packages/doctrine.yaml
doctrine:
orm:
naming_strategy: doctrine.orm.naming_strategy.underscore
```
Cheers! ...
For those who struggling filtering collection of entities with @Embedded ones. AFAIK it's not possible to apply Criteria API to the property of @Embedded entity. You can be saved with \Doctrine\Common\Collections\ArrayCollection::filter method ...
Hey Mark
Have you take a look to this? https://symfony.com/doc/current/doctrine/pdo_session_storage.html
Seems like you just need to tell Symfony to write the session into the DB instead of a file
Cheers! ...
... class "MySqlPlatform" from namespace "Doctrine\DBAL\Platforms".
Did you forget a "use" statement for another namespace?
Can someone help me?
Hello there,
When building a project from scratch, what is a preferred way - to design and create database first then generate entity classes (https://symfony.com/doc/current/doctrine/reverse_engineering.html) or create entity first then migrate it into database?
Thank you! ...
I kind of agree if you use an ORM like Doctrine but still you can be coding some vulnerable code. Like for example, not escaping variables coming from user input.
cheers! ...
... Hi Guys, I'm getting an error when trying to run this - PHP Fatal error: During class fetch: Uncaught ReflectionException: Class Symfony\Component\Form\FormTypeGuesserInterface not found in /vendor/symfony/doctrine-bridge/Form/DoctrineOrmTypeGuesser.php:25. Can anyone provide some help?
in this case you have 2 options.
First is to upgrade your server
Second is more interesting you can try configure `doctrine.dbal.server_version` to correspond you server version
Example:
```
doctrine:
dbal:
server_version: 'mariadb-10.1.3'
```
Hope it will help you, Cheers! ...
Hey Jakub G.
Doctrine doesn't come with a "timestamp" field type but AFAIK you can use a Datetime field as if it were a Timestamp field
I hope it makes any sense to you :)
Cheers! ...
To encode my password in setPassword method, can i use doctrine listener from this tutorial?
https://symfonycasts.com/screencast/symfony3-security/encoding-user-password
Or symfony 4 need to use another technic? ...
Hey @Christopher
It's caused by outdated `stof/doctrine-extensions-bundle`. Where have you got this deprecation message? Is it in our course code? Have you followed course from the start? or playing with finish directory?
Cheers! ...
Hey Andrei V. ,
For Symfony 4 we recommend using DoctrineFixturesBundle along with Faker library, we even have a related screencasts for it in our Symfony 4 series, you can check it here: https://symfonycasts.com/screencast/symfony-doctrine/fixtures .
Cheers! ...
Sorry Victor, I was sure I had replied... I actually meant the Doctrine Extensions with the StofDoctrineExtensionsBundle. But it looks as if that project is revitalised...
Any news about this tutorial, is it on the board? ...
Hello,
I have a small question, i have this error " Could not convert database value "ROLE_ADMIN" to Doctrine Type json ", i don't understand why i have this error, is it the version of MySQL? ...
Hi AndTheGodsMadeLove
Sorry for this issue!
`doctrine-fixtures-bundle` has been updated since course came out. We used version "`3.0.2`" in this tutorial, try to install it, and report us back if it solved your issue.
Cheers! ...
Hey Amin A.
I believe you haven't installed the Doctrine migrations bundle. Once you install it you should not have this error anymore (unless I'm missing something :p)
```
composer require symfony/maker-bundle --dev
`` ...
MolloKhan Thanks for response.I would like to go another way.
It's a good point of view? -> to map old system login database table to doctrine entity.
And then create CustomAuthenticator which checks and in getUser put all logic? ...
2726
Doctrine
Filter Results