Doctrine Behaviors 2 is out!
https://www.tomasvotruba.cz/blog/2019/12/30/doctrine-behaviors-2-0-reloaded/ ...
|
// ... lines 1 - 42
|
|
|
|
doctrine: |
|
dbal: |
|
// ... line 46
|
|
host: "%database_host%" |
|
port: "%database_port%" |
|
dbname: "%database_name%" |
|
user: "%database_user%" |
|
password: "%database_password%" |
|
// ... lines 52 - 79
|
See Code Block in Script
|
doctrine: |
|
// ... lines 2 - 7
|
|
orm: |
|
// ... lines 9 - 18
|
|
filters: |
|
fortuneCookie_discontinued: |
|
class: App\Doctrine\DiscontinuedFilter |
|
enabled: true |
|
parameters: |
|
discontinued: false |
|
// ... lines 25 - 51
|
See Code Block in Script
|
// ... lines 1 - 2
|
|
return [ |
|
// ... lines 4 - 13
|
|
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true], |
|
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true], |
|
]; |
See Code Block in Script
...
`- Removing doctrine/doctrine-cache-bundle (1.3.5)
- Removing fzaninotto/faker (v1.8.0)
- Removing jdorn/sql-formatter (v1.2.17)
- Removing symfony/contracts (v1.1.5)
- Removing symfony/test-pack (v1.0.6)
- Removing ...
Migrations
... Doctrine compared the current state of our
entities to the database and generated the SQL needed to make them match.
Wow!
There's also a down() method... because migrations can be reversed, but I've
never done that, so I ...
Doctrine’s QueryBuilder
... /UserRepository.php
// ...
class UserRepository extends EntityRepository
{
}
To make queries, you can use an SQL-like syntax called DQL, for Doctrine
query language. You can even use native SQL queries if you’re doing ...
You mention in the video to not bother with the version info on the composer command for the doctrine-migration-bundle, but the installation failed for me without it. When I used the entire command given at on the ...
Hi Guys:
Is it possible to roll back you doctrine schema. I know you are going to introduce Doctrine Migrations bundle for the following lesson. But my old project doesn't have Doctrine Migrations bundle, and I want ...
... That's probably not a bad idea - I try to avoid Doctrine listeners if I can, and instead do work in services, and call those services when needed. Doctrine is great, but Doctrine listeners are a weird place, where you're already right in the middle of saving something. Not a bad policy to avoid :).
Cheers!
... //symfony.com/doc/current/doctrine/custom_dql_functions.html
Doctrine docs: https://www.doctrine-project.org/projects/doctrine-orm/en/current/cookbook/dql-user-defined-functions.html
Cheers!
Hey 3amprogrammer ,
You're right, Doctrine relates to the database, but also it relates to the data in common. Doctrine has a nice doctrine/cache library which helps to cache data, i.e. you could easily cache data which you fetch from a database, which in turn reduce a database server loading.
Cheers! ...
Hey |mention:76041|
That's a good question. I believe Doctrine does not support setter methods. They are not explicit about it in the docs though https://www.doctrine-project.org/projects/doctrine-orm/en/latest/reference/dql-doctrine-query-language.html#new-operator-syntax
I'd just give it a try to confirm it
Cheers! ...
... "Doctrine itself doesn't come with any pagination features."
"Doctrine\ORM\Tools\Pagination\Paginator" is there at least from 2013 (version 2.4).
It is very simple to compare with KnpPagination Bundle, but it is there.
This pure doctrine paginator is also used in the Symfony FastTrack book.
Hey davidmintz
The `doctrine/cache` library was deprecated some time ago. I'm not sure how you ran into this problem but I'm guessing you upgraded the DoctrineBundle library. Try upgrading all doctrine libraries by running
```
composer upgrade "doctrine/*"
```
and clear the cache manually just in case `rm -rf var/cache` ...
Cheers! And yea, I think Doctrine is much harder than Symfony :). Doctrine gets tricky with relationships, and it really just comes down to getting the configuration correct, then everything works nicely. Doctrine is ...
... FYI it's not compatible with Symfony 4.4 and you will need to change some files
`src/Repository/ImagePostRepository.php ` replace `Symfony\Bridge\Doctrine\RegistryInterface` with `Doctrine\Persistence\ManagerRegistry ...
Hey Nizar
To remove the generate images by the bundle you can use its Cache service and call `remove()` on it passing the path to the file. And, you can make it automatic if you create a Doctrine listener for hooking ...
Unbelievable that a mature orm framerowk like Doctrine doesn't support having attributes on a many-to-many relationship. To me that's enough to dismiss Doctrine as garbage and start looking for alternatives. What is disturbing is that Symfony seems to "promote" Doctrine as the go-to choice for orm. ...
2725
Doctrine
Filter Results