2725 search results for Doctrine

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
PropertyFilter Sparse Fieldsets

... hydra:search. Filters are super fun. Tons of filters come built-in, but you can totally add your own. From a high-level, a filter is basically a way for you to modify the Doctrine query that's made when fetching a collection ...

5:34
User API Resource

... that's supported by Doctrine and API Platform. UUIDs work with any database, but they are stored more efficiently in PostgreSQL than MySQL, though we use some UUID's in MySQL in some parts of SymfonyCasts. But... why am ...

7:20
SerializedName Constructor Args

... because of a new feature that can automatically convert your database rules - the fact that we've told Doctrine that title is required in the database - into validation rules. Fun fact, this feature was contributed to ...

7:15
Our First ApiResource

... cheese_listing... Yea! Looks good! Close that and run: php bin/console doctrine:migrations:migrate Brilliant! At this point, we have a completely traditional Doctrine entity ...

5:37