2708 search results for Doctrine

Completely Custom Field via a Data Provider

... don't need to think about this system because API Platform has a built-in Doctrine data provider that handles all of it for us. But if we want to load some extra data, a custom data provider is the key. In the src ...

9:19
Decorating Data Persisters vs Context Builders

... that. Let's do some digging: run bin/console debug:container and search for api_platform. This shows all of the services from ApiPlatform... which is a bunch. Search for "doctrine". Ok: a metadata factory and... ah ...

8:54
Serialization Groups

... of a Doctrine error, you may have gotten a validation error. That's due to a new feature where Doctrine database constraints can automatically be used to add validation. So, if you see a validation error, awesome ...

9:34
File Upload Field in a Form

... people create this property on their entity, just to make the form work. They don't persist this property to the database with Doctrine... so the idea works, but I don't love it. Instead, we'll use a trick that we talked a ...

9:09
Querying for Data

... learn how to write custom queries soon. Above this line, just to help my editor, I'll tell it that this is an Article object: And... hold on, that's important! When you query for something, Doctrine returns objects ...

9:16
Integration Tests

... you mock everything... there's nothing really left to test For example, how would you test that a complex query in a Doctrine repository works? If you mock the database connection then... I guess you could test that the ...

9:18
Prime Time with Messenger Queues Workers more Fun Ryan Weaver

... there's people like Tobias Nyholm uses that all the time. So in his handlers, he just kind of writes doctrine code and there's something else that wraps that in a transaction and then commits the transaction afterwards. Um ...

44:36
Relating Custom ApiResources

... it reads the Doctrine relationship metadata to figure out that a property is a collection of some other #[ApiResource] object. Long story short, this is simple to fix... it's just hard to understand at first. Above the ...

5:13
Setup Ways to Extend API Platform

... been Doctrine entities. And that's fine! But as your API starts to look different from your entities, making that work adds complexity: serialization groups, extending normalizers, etc. At some point, it becomes easier and ...

4:39
A World without Build Systems

... .. hello Mixed Vinyl! But wow is this thing weird and ugly-looking. This is a Symfony 6.3 project - the same project we've built in the Symfony series. It has Doctrine installed... but there's nothing particularly special ...

4:04
Reusing Queries in the Query Builder

... (make sure you get the one from Doctrine\ORM - the "Object Relational Mapper"), and let's call it $qb. This will also return a QueryBuilder. The next step is pretty simple. Go steal the JOIN logic from above... and, down ...

4:42
Totally Custom Fields

... with a state provider. We haven't talked about state providers yet, but they're how data is loaded. For example, our classes are already using a Doctrine state provider behind the scenes to query the database. We'll cover ...

3:24
Removing Items from a Collection

... property. After cascade, add one more option here: orphanRemoval: true. This tells Doctrine that if any of these dragonTreasures become "orphaned" - meaning they no longer have any owner - they should be deleted. Let's try it ...

3:49
Docker Environment Variables

... symfony var:export --multiline But the most important one by far is DATABASE_URL. Ok: Doctrine is configured! Next, let's create the database itself via a bin/console command. When we do that, we'll learn a trick for doing this with the environment variables from the Symfony binary.

3:43
MakerBundle Autoconfiguration

... make section. Ooh. There's a ton of stuff here for setting up security, generating doctrine entities for the database (which we'll do in the next tutorial), making a CRUD, and much more. Let's try one: how about we try to ...

4:27
Recipe Upgrades Part 2

Run: composer recipes:update Next up is doctrine-extensions-bundle. This one... when we look... just modified a comment! Easy!. So commit that... and then move onto debug-bundle ...

5:50
Annotations to Attributes

... Next, let's add property types to our entities. That's going to allow us to have less entity config thanks to a new feature in Doctrine.

5:14
QuestionTag Fixtures DateTimeImmutable with Faker

... datetime_immutable Doctrine type. This means that, instead of that property being a DateTime object, it will be a DateTimeImmutable object. Really... the same thing... except that DateTimeImmutable objects can't be changed. The ...

4:07
JOINing Across Multiple Relationships

... Question and Tag. Doing that is legal in SQL... but it messes up how Doctrine creates the objects, so it doesn't allow it. The solution is easy enough: select both. You can actually pass an array to addSelect() to select ...

3:52
Foundry Always Pass a Factory Instance to a Relation

I love Foundry. But using Foundry with Doctrine relationships is probably the hardest part of this library. So let's push a bit further. Pretend that, in this situation, we want to override the question value. Right now ...

4:57