2708 search results for Doctrine

Custom Resource GET Item

... /daily-stats.jsonld and refresh... there are a lot of items here. Since we're not using Doctrine, we no longer get pagination for free. If we need it, we have to add it ourselves.

5:50
Custom Resource Data Provider

... already a unique identifier: we're only going to have one DailyStats per day: How do we tell API Platform to use this property as the identifier? In Doctrine, it happens automatically thanks to the @ORM\Id annotation ...

6:40
Entity objects in Twig

... made to /questions/new. Click the little token string on the right to jump into the full profiler for that request! Go to the "Doctrine" tab and... bam! Cool! It even wraps the INSERT in a transaction. Remember this trick ...

4:55
Foundry Fixture Model Factories

... library instead. Google for "Zenstruck Foundry" and find its GitHub Page. Foundry is all about creating Doctrine entity objects in an easy, repeatable way. It's perfect for fixtures as well as for functional tests where ...

5:56
make:docker:database

Doctrine is installed! Woo! Now we need to make sure a database is running - like MySQL or PostgreSQL - and then update the DATABASE_URL environment variable to point to it. So: you can absolutely start a database ...

5:24
How Entity Controller Arguments Work

... But where is that code? At first, you might think this is another argument value resolver. But, there's nothing in that list that mentions "doctrine" or "entity". In reality, this is working via a different system. If ...

4:54
Events Events Events

... request-response process. You can see - kind of in the middle here - is our controller: it took 36 milliseconds to execute. You can see the Twig templates being executed below it, and even little Doctrine queries ...

5:10
Processing Encore Files through inline_css

... ". You can learn about this in, oddly-enough, our tutorial about Symfony & Doctrine. To fetch the service, go down to getSubscribedServices() and add EntrypointLookupInterface::class. Back up in getEncoreEntryCssSource ...

7:27
Recommendations

... radar. There's also a recommendation that Doctrine annotation metadata should be cached in production. Honestly... I'm not sure why that's there - Symfony apps come with a config/packages/prod/doctrine.yaml file that takes ...

6:25
Async Emails with Messenger

... - called "messages" - will be sent. Messenger calls these transports. Because we're already using Doctrine, the easiest "queueing" system is a database table. Uncomment that MESSENGER_TRANSPORT_DSN to use it. Next, open ...

6:11
Unit Testing our Emails

... we mock the User object? We could, but as a general rule, I like to mock services but manually instantiate simple "data" objects, like Doctrine entities. The reason is that these classes don't have dependencies and it's ...

7:56
Serializing Messages as JSON

... messenger.transport.symfony_serializer. When a message is sent to a transport - whether that's Doctrine, AMQP or something else - it uses a "serializer" to encode that message into a string format that can be sent. Later, when it reads a ...

6:41
Resetting the Database Between Tests

... each other. It was the inspiration behind a fixture class that we created and used in our Symfony Doctrine tutorial. The recipe creates a fixtures/ directory for the YAML files and a new command for loading that data. But ...

4:51
Logging in Inside the Test

... doctrine then say ->getManager(). You can also use the type-hint you use for autowiring as the service id. In other words, self::$container->get(EntityManagerInterface::class) would work super well. And actually... it's ...

6:57
Login with json_login

... the last tutorial for us by the make:user command. It tells the security system that our User lives in Doctrine and it should query for the user via the email property. If you have a more complex query... or you need to ...

6:27
Testing with the in-memory Transport

... if you're using the Doctrine transport. Fortunately, there's a more interesting option. Start by copying config/packages/dev/messenger.yaml and pasting that into config/packages/test/. This gives us messenger ...

5:26
Investigating Retrying Failed Messages

... it should do it. Also, not all the transport types - like AMQP or Redis - support all of the features we just saw if you use it as your failure transport. That may change in the future, but at this moment - Doctrine is ...

5:41
Installing Messenger

... creates a new ImagePost entity, saves it to the database with Doctrine and then, down here, we have some code to add Ponka to our photo. That ponkafy() method does the really heavy-lifting: it takes the two images ...

6:15
Removing Items from a Collection

... CheeseListings in this array suddenly... are not in this array, Doctrine will delete them. Just, realize that if you try to reassign a CheeseListing to another User, it will still delete that CheeseListing. So, just make sure you ...

5:29
Creating the User Entity

... check the SQL: CREATE TABLE user - looks good! Run it with: php bin/console doctrine:migration:migrate Perfect! We have a gorgeous new Doctrine entity... but as far as API Platform ...

5:07