2725 search results for Doctrine

We 3 Creating Stripe Customers

... () method returns a Stripe\Customer object: And we like that because this object has an id property. To save that on our user record, say $user->setStripeCustomerId($customer->id): Then, I'll use Doctrine to run the UPDATE ...

4:37
Saving Users

... Doctrine\Common\DataFixtures\FixtureInterface; use Doctrine\Common\Persistence\ObjectManager; use Yoda\UserBundle\Entity\User; class LoadUsers implements FixtureInterface { } Saving users is almost easy: just create the ...

3:37
Flex Recipe Updates

... doing our real job. I'll hit enter to go down the list one-by-one. First up is Doctrine Bundle: and it's a complex update. It even caused a conflict! Sometimes we might see that a recipe update changes something - like ...

6:04
Testing Messenger

... Messenger: composer require symfony/messenger Lovely! In .env, this added a MESSENGER_TRANSPORT_DSN which, by default, uses the Doctrine transport type. Though, it won't matter ...

7:18
DTO Entity State Processor

... talked about what's happening: the JSON is deserialized into a UserApi object. Good! Then the core Doctrine PersistProcessor is called because that's the default processor when using stateOptions. But... because our UserApi ...

7:39
EXTRA_LAZY Relationships

... data.... just to count them... isn't the greatest thing for efficiency. If you find yourself in this situation, you can tell Doctrine to be clever with how it loads the relation. Go into the Category entity and find ...

6:07
Selecting Specific Fields

... Love it! Getting full entity objects back from Doctrine is the ideal situation because... objects are just really nice to work with. But at the end of the day, if you need to query for specific data or columns, you can ...

5:09
andWhere and orWhere

... shouldn't either. Using andWhere() is always ok - even if this is the first WHERE clause... and we don't really need the "and" part. Doctrine is smart enough to figure that out. What's wrong with ->where()? Well, if you ...

7:06
Installing API Platform

... scroll down, it installed api-platform itself, Doctrine, since I didn't already have that, and some other packages. At the bottom... let's see... the doctrine-bundle recipe is asking us if we want to include a docker ...

7:29
Contentful Loading Data from an External CMS

... quick process and would give us a lot of power on our site. But one of the beautiful things about Layouts is that our value types can come from anywhere: a Doctrine Entity, data on an external API, data in a Sylius store ...

8:02
Upgrading to Symfony 6.0

... sure the homepage works. It... doesn't!? We get Attempted the load class QueryAdapter from namespace "Pagerfanta\Doctrine\ORM. This shouldn't be a surprise... since we did upgrade pagerfanta-bundle from 2.8 to 3.6. This is ...

7:07
Making Questions owned by Users

Our site has users and these questions are created by those users. So in the database, each Question needs to be related to the User that created it via a Doctrine relationship. Right now, if you open src/Entity ...

5:13
make:user

... HumanoidEntity. If the "thing" that logs into your site would be better called a Company or University or Machine, use that name here. Do you want to store user data in the database via Doctrine? For us: that's a ...

5:57
ManyToMany with Extra Fields on the Join Table

The ManyToMany relationship is unique in Doctrine because Doctrine actually creates & manages a table - the join table - for us. This is the only time in Doctrine where we have a table without a corresponding entity ...

6:57
Owning Vs Inverse Sides of a Relation

... There's a, kind of, complex topic in Doctrine relations that we need to talk about. It's the "owning versus inverse side" of a relationship. We already know that any relation can be seen from two different sides ...

7:11
Collection Types and readableLink

... whether it's required. And it gets that from many different sources like Doctrine metadata and our own PHPDoc. And because collecting all of this can take time, it caches it. Now, API Platform is really good in dev mode ...

7:12
Property Metadata

... knows nothing about the types of each field. Are these strings? Integers? Aliens? API Platform gets metadata about each property from many different places, like by reading Doctrine metadata, PHPDoc, looking at the return ...

6:20
Completely Custom Resource

... Doctrine entity, it's much easier to add a few custom fields than to reinvent the wheel with a custom resource. After all, with a Doctrine entity, we get things like pagination and filtering for free! But sometimes... you ...

5:25
Custom Item Data Provider

... interface because that's what the core Doctrine item data provider uses... and I want to be able to pass it the same arguments. Ok: go to the "Code"->"Generate" menu - or Command+N on a Mac - and implement the one method we ...

6:57
Handling Messages Sync while Developing

... Messenger supports several different types of transport like Doctrine, redis and AMQP. And the way you choose which one you want is the beginning of the connection string, like doctrine://. The sync transport is really neat ...

5:54