2710 search results for Doctrine

Criteria System Champion Collection Filtering

... better way?! Introducing, Doctrine's Criteria system: a part of Doctrine that's so useful... and yet... I don't think anyone knows it exists! Here's how it looks: create a $criteria variable set to Criteria::create ...

5:24
Controlling Data Fixtures in a Test

... parent test class: // src/Yoda/UserBundle/Tests/Controller/RegisterControllerTest.php // ... public function testRegister() { } Now, grab the Doctrine entity manager by getting the doctrine service and calling getManager ...

3:23
Filters

... CategoryRepository and add some andWhere() calls in here for fc.discontinued = true. But what if we wanted this WHERE clause to be added automatically, and everywhere across the site? That's possible, and it's called a Doctrine ...

10:29
Filters Automatically Modify Queries

Thanks to our cool new method, we can filter out discontinued fortune cookies. But what if we want to apply some criteria like this globally to every query to a table? Like, telling Doctrine that whenever we query for ...

6:59
Custom Filter apply

... data provider, not via some magic system that runs after them. Let's look at how this is done in the core Doctrine data provider. Hit Shift+Shift, search for doctrinedataprovider and include non project items. There it is ...

8:15
The Failure Transport

... can have as many transports as you want. This one starts with doctrine://default. If you look at our .env file... hey! That's exactly what our MESSENGER_TRANSPORT_DSN environment variable is set to! Yep, both our async and ...

5:37
Collection Magic with Criteria

... object even has a filter() method to make this easier! But... there's a problem. If we did this, Doctrine would query for all of the comments, even though we don't need all of the comments. If your collection is pretty small ...

7:45
Custom Queries

How do you write custom queries in Doctrine? Well, you're already familiar with writing SQL, and, yea, it is possible to write raw SQL queries with Doctrine. But, most of the time, you won't do this. Instead, because ...

6:20
OneToMany The Inverse Side of a Relationship

OneToMany: The Inverse Side of a Relationship¶ Earlier, we gave every Event an owner. This was our first Doctrine relationship: a ManyToOne from Event to User. This lets us do things like call $event->getOwner ...

5:37
Query Extension Auto-Filter a Collection

... this filter to be automatic. An API client should never see unpublished listings. Filters are a good choice for optional stuff, but not this. Another option is called a Doctrine filter. It's got a similar name, but is a ...

9:37
The King of Relations ManyToOne

... ManyToOne association. The second type is called a ManyToMany association. To use a different example, this would be if each product had many tags, but also each tag related to many products. And when it comes to Doctrine ...

2:27
Fixtures For some dumb data

... and paste the example from the docs. Change the namespace above the class to match our project. Notice that the namespace always follows the directory structure of the file: Now we just use normal Doctrine code to create ...

1:54
An Aside Dependency Injection Parameters

An Aside: Dependency Injection Parameters¶ Cleanse the palette of all the forms stuff and open config.yml. Under the doctrine key, we see a bunch of percent sign values: # app/config/config.yml # ... doctrine ...

1:41
Sharing Data between Fixture Classes

... method called getOrder. Let’s return 10: // src/Yoda/UserBundle/DataFixtures/ORM/LoadUsers.php // ... use Doctrine\Common\DataFixtures\OrderedFixtureInterface; class LoadUsers implements FixtureInterface ...

1:49
Symfony 3 Level up with Services and the Container

Our app is coming to life! Thanks to the Doctrine Course we have a rich data model. And after the course on Configuration, well, using and configuring services is simple. Now it's time to level-up with those services ...

9 videos
|
33:46
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 ...

7 videos
|
4:30:19
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 ...

4:03
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 ...

3:13
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 ...

2:16
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 ...

10:07