Symfony Live Lille 2019 French
... des sujets sur Symfony (évidemment), mais aussi Mercure, Doctrine, API Platform ou encore React et Redux ainsi que des bonnes pratiques sur les meilleurs bundles et outils pour vos applications Symfony, et d’autres ...
Activating Timestampable
... means that
we can already test things with:
php bin/console doctrine:fixtures:load
Thank you TimestampableEntity!
Ok guys! I hope you are loving Doctrine! We just got a lot of ...
Adding More Columns
... full-list of all the built-in
Doctrine types, check their docs. The most important are string, integer, text,
datetime and float.
Next, head to the bottom of the class to create the getter and setter methods. But
wait ...
User Serialization
... and deserializes
the user information is called ContextListener.
This is great! And it’s obviously working great - we’re surfing around as
Wayne the admin. But there’s a “gotcha” in Doctrine. Sometimes, Doctrine will ...
stateOptions entityClass Magic
... Doctrine state
provider: query the database. It's a bummer to reinvent all of that logic ourselves.
This, historically, has been the Achille's heel of DTO's.
Crack open the core CollectionProvider from Doctrine ORM. If you ...
Criteria Filter Relation Collections
... hiding the discontinued ones.
Open up the Category entity and find getFortuneCookies(). There it
is. Below, add a new method called getFortuneCookiesStillInProduction(). This,
like the normal method, will return a Doctrine ...
Triaging a Bug Issue
... when trying to serialize a Doctrine
QueryBuilder with the web profiler: something about not being able to serialize
a PDO instance.
The web profiler works by collecting a bunch of information about the request
and ...
Reusable Entity->Dto Provider Processor
Our UserAPI is now a fully functional API resource class! We've got our
EntityToDtoStateProvider, which calls the core state provider from Doctrine, and
that gives us all the good stuff, like querying, filtering, and ...
Provider Transforming Entities to DTOs
... Let's keep track of the goal. When we first used stateOptions, it triggered the
core Doctrine collection provider to be used. That's great... except that it
returns User entities, meaning that those became the central ...
SELECTing into a New DTO Object
Having the flexibility to select any data we want is awesome. Dealing with
the associative array that we get back is... less awesome! I like to work with
objects whenever possible. Fortunately, Doctrine gives us a ...
The symfony console Command server_version
Doctrine is now configured to talk to our database, which lives inside a Docker
container. That's thanks to the fact that the Symfony dev server exposes
this DATABASE_URL environment variable, which points to the ...
ManyToMany Relation
... foreign key column and a tag_id foreign key column. That's it.
And... this makes sense! Even outside of Doctrine, this is how you build a
ManyToMany relationship: you create a "join table" that keeps track of which
tags ...
doctrine:database:create server_version
... var:export, you can see
that the database name is apparently "main". But that does not exist yet.
No problem! When we installed Doctrine, it added a bunch of new bin/console
commands to our app. Run ...
Hunting the Final Deprecations
... "pipe" it to grep Deprecated:
We're now watching the log file for any lines that contain Deprecated. Unfortunately,
because of that annoying doctrine/persistence stuff, it does contain extra
noise. But it'll still work ...
Problems with Entities in Messages
... Doctrine keeps track of a list of all
the entity objects that it's currently dealing with. When you query for an entity,
it adds it to this list. When you call persist(), if it's not already in the list,
it's added. Then ...
JOINs
I love JOINs. I do! I mean, a query isn't truly interesting unless you're
joining across tables to do some query Kung fu. Doctrine makes JOINs really
easy - it's one of my favorite features! Heck, they're so easy that I ...
And WHERE Or WHERE
The most common thing to do in a query is to add a WHERE clause. Unfortunately,
Doctrine doesn't support that. I'm kidding!
I have a search box - let's search for "Lucky Number". This isn't hooked
up yet, but it adds a ...
Saving the Inverse Side of a ManyToMany
... What's going on!?
This is the moment where someone who doesn't know what we're about to learn,
starts to hate Doctrine relations.
Earlier, we talked about how every relationship has two sides. You can start with
a Genus ...
Adding Outside Bundles with Composer
...
our pre-started project that came with Symfony and other tools like Doctrine.
Unfortunately, it didn't come with any tools for handling fixtures.
But we're smart enough: let's just add a fixtures library ourselves. And ...
Entities DTO's The Central Object
This entity class thing seems almost too good to be true. It gives us all the
flexibility, in theory, of a custom class, while reusing all the core Doctrine
provider and processor logic. But hold your horses because ...
2725
Doctrine
Filter Results