2725 search results for Doctrine

... ", "composer/package-versions-deprecated": "^1.11", "doctrine/annotations": "^1.0", "doctrine/doctrine-bundle": "^1.6", "doctrine/orm": "^2.4.5", "nelmio/cors-bundle": "^1.5 ...
Hey Tomas, Good qustion! Well, ManagerRegistry is something more global in Doctrine, it will allow you to get instance to the entity manager iteself, to other Doctrine features. You can look at that service to see what ...
... - same idea, but I like this a little better) - http://doctrine-orm.readthedocs.org/projects/doctrine-dbal/en/latest/reference/types.html#json-array. In this case, your roles property is an array, but in MySQL, Doctrine ...
weaverryan
weaverryan
Read Full Comment
Entity DTO Item State Provider

... querying work manually. Instead, we'll... "delegate" it the core Doctrine item provider. Add a second argument... we can just copy the first... type-hinted with ItemProvider (the one from Doctrine ORM), and called ...

4:11
Auto Setting the owner

... processor that comes from Doctrine: it's responsible for saving the object to the database. Our goal will feel familiar at this point: to decorate that state process so we can run extra code before saving. Like before, start ...

4:19
Adding Items to a Collection Property

... important because of how Doctrine handles relationships: setting the owner sets what's called the "owning" side of the relationship. Basically, without this, Doctrine wouldn't save this change to the database. The takeaway is ...

4:04
The 4 2 Possible Relation Types

Officially, there are four types of relations in Doctrine: ManyToOne, OneToMany, OneToOne and ManyToMany. But... that's kind of a lie! In reality, there are only two types. Let me explain. We already know that a ...

4:02
Saving Relations

... property, we're setting the entire Question object onto the property. Doctrine will be smart enough to save these in the correct order: it'll save the question first, grab its new id, and use that to save the Answer. To ...

3:58
Input Data Transformer

... object. Second, we transform that CheeseListingInput into a CheeseListing in the data transformer. And third, the normal Doctrine data persister saves things. That's a really clean process! Go back to the docs and look at the ...

4:24
Adding Populating the Custom Field

... return $users: Back at the browser, find the original tab and refresh. Oh! It's not an array of users! It's a Paginator object with a Doctrine Paginator inside! So... this obviously isn't an array, but the Paginator ...

5:10
docker-compose Env Vars Symfony

... variable that Doctrine is looking for. I'll show you exactly what I mean. First, go back to your browser, watch the bottom right of the web debug toolbar, and refresh. Ah! The little "Server" icon turned green! This is ...

4:59
Upgrading/Migrating from StofDoctrineExtensions

... upgrade this the lazy way: find the package name and copy it: We're hoping a minor upgrade - maybe from 1.3 to 1.4 - will fix things. Update! composer update stof/doctrine-extensions ...

4:50
When Migrations Fail

My other favorite Doctrine Extension behavior is timestampable. Go back to the library's documentation and click to view the Timestampable docs. Oh, it's so nice: with this behavior, we can add $createdAt and $updatedAt ...

5:34
All about Entity Repositories

... class's repository, Doctrine should give us an instance of this ArticleRepository class: Oh, and the built-in find*() methods actually come from one of the parent classes of ArticleRepository. So... why the heck are we ...

5:35
Autowiring Deprecations

... EntityManagerInterface! But... there's another solution! If you want, it is totally ok to type-hint EntityManager. To make this work with autowiring, we can create an alias. Copy the Doctrine\ORM\EntityManager class name. Then ...

5:36
Selecting Specific Fields

... don't trust myself. So, var_dump($fortunesPrinted) in the controller with our trusty die statement: Refresh! Uh oh, that's an awesome error: This is what it looks like when you mess up your DQL. Doctrine does a really ...

5:04
Tests with the Container

... EntityManager. And that also means we have an easy way to clear data. Create a new private function called purgeDatabase(). Because we have the Doctrine DataFixtures library installed, we can use a great class called ...

4:23
Deleting an Item from a Collection orphanRemoval

... database? The problem is that the genusScientists property is now the inverse side of this relationship: In other words, if we remove or add a GenusScientist from this array, it doesn't make any difference! Doctrine ...

5:14
EntityType Checkboxes with ManyToMany

... field. The type will be EntityType: This is your go-to field type whenever you're working on a field that is mapped as any of the Doctrine relations. We used it earlier with subfamily. In that case, each Genus has only ...

5:39
Removing a ManyToMany Item

... object to the genusScientists property: So guess what? To remove that link and delete the row in the join table, we do the exact opposite: remove the User from the genusScientists property and save. Doctrine will ...

5:16