... package information
Installing dependencies (including require-dev) from lock file
Package operations: 41 installs, 0 updates, 0 removals
- Installing doctrine/lexer (v1.0.1): Loading from cache
...
[OK] All assets ...
... some new insights in the logs :
security.DEBUG: User was reloaded from a user provider. {"provider":"Symfony\\Bridge\\Doctrine\\Security\\User\\EntityUserProvider","username":"yvon.huynh"} []
[2019-09-16 10:30:03 ...
Autoconfiguration
... too.
And that's it! We've covered the fundamentals of Symfony services,
configuration, and environments. We are powerful! No, unstoppable.
In the next tutorial, we'll introduce Doctrine - the industry standard way to ...
Pagination Column Sorting
...
composer require babdev/pagerfanta-bundle pagerfanta/doctrine-orm-adapter pagerfanta/twig
Cool beans! Let's get the PHP side working first. Open src/Controller/MainController.php.
The current page will be stored on the ...
Test Environment Database Setup
... point to that container.
When we refresh the page... it's not using the DATABASE_URL from my .env:
it's using the dynamic value that's set by the symfony binary. This is something
that we talked about in our Doctrine ...
Quick Create a DragonTreasure DTO
... system will still use the core Doctrine CollectionProvider, this query
extension stuff will continue to work and be called. That's just one less
thing we need to worry about.
Head over and refresh the documentation. Ok! Only ...
Pagination on a Custom Resource
... "jobs" of pagination. First, to return the correct subset of
the 50 results - which we'll do in a moment. Second, to return the count of the
total number of items. When you use Doctrine, it executes 2 separate queries
for ...
Bootstrapping a Killer Test System
... is cool: when we're in the test
environment, there's a bit of config called dbname_suffix. Thanks to this, Doctrine
will take our normal database name and add _test to it:
This next part is specific to a library called ...
Subresources
... }. It knows how to make that query by looking
at the Doctrine relationship and figuring out which column to use. It's super
smart.
We can actually see this in the profiler. Go to /_profiler, click on our request...
and ...
Adding Lists Value Type
... products. The same is true if you're using Ibexa CMS.
So here's our next big goal: to add our Recipe Doctrine entity as a "value
type" in layouts so that we can create lists and grids containing recipes.
Step one to ...
Querying for a Single Entity for a Show Page
... id: 16! The important thing to
notice is that this returns a VinylMix object. Unless you do something custom,
Doctrine always gives us back either a single object or an array of objects,
depending on which method you ...
All About services.yaml
... (). So, these will not
be services in the container.
In the next tutorial, we'll create Doctrine entity classes, which are model classes
for the database. These will live in the src/Entity/ directory... and since
they're ...
Doing Crazy things with Foundry Fixtures
... created in the
database. Instead, the new QuestionTag object will be related to whatever Question
is currently being created. Foundry does this by reading the Doctrine relationship
and smartly overriding the question ...
Search the Request Object OR Query Logic
... totally forgot that we were already
filtering WHERE status = approved. But because we put the OR statement inside
of the andWhere(), Doctrine surrounded the entire fuzzy search part with parentheses.
If we had used orWhere ...
Publish State Change Validator Logic
... is it changing from
false to true? Or true to false? Or maybe it's not changing at all because the
PUT request is only updating other fields.
And hey! We already know how to get the original data from Doctrine! We did it ...
Validating Who/When Can Publish
... published, even though the description is short. Next,
let's prevent this. How? It's back to our "original data" trick from Doctrine.
Request Object POST Data
... could do this with an AJAX call instead of a form submit. From
a Doctrine and Symfony perspective, it really makes no difference. So I'll
keep it simple and leave JavaScript out of this.
Let's start by creating that endpoint ...
Smarter Entity Methods
... new row with null for that column. What we probably want to do is
default votes to be zero. How can we set a default value for a column in
Doctrine?
Actually, that's not really the right question to ask. A better question ...
ACL Only Owners can PUT a CheeseListing
... Needing the entity manager
is so common, let's create another shortcut for it:
protected function getEntityManager() that will return EntityManagerInterface.
Inside, return self::$container->get('doctrine')->getManager ...
2724
Doctrine
Filter Results