1000 search results

Adding More Columns

…above each: These tries to guess the right field type - but it's not always right. speciesCount should clearly be an integer - set it to that. For a full-list of all the built-in Doctrine types, check their docs. The most important are string…

3:13
Creating an Entity Class

…need a use statement for it. This will look weird, but add a use for a Column class and let it auto-complete from Doctrine\ORM\Mapping. Remove the Column part and add as ORM: Every entity class will have that same use statement. Next…

5:29
Sharing Data between Fixture Classes

…ORM/LoadUsers.php // ... use Doctrine\Common\DataFixtures\OrderedFixtureInterface; class LoadUsers implements FixtureInterface, ContainerAwareInterface, OrderedFixtureInterface { } Head over to LoadEvents and make the same change, except returning 20 so that the class is run second: // src/Yoda/EventBundle/DataFixtures/ORM/LoadEvents.php // ... use Doctrine\Common\DataFixtures\OrderedFixtureInterface…

1:49
Introduction

…the hood. We’ll learn what a service is, find out more about the core Symfony services and create a few of our own. In Doctrine, we’ll create some ManyToOne and ManyToMany relationships. We’ll also talk about lifecycle callbacks and event listeners. And…

1:00
Introduction

…some of the most difficult areas of Symfony, like security, forms, and some serious Doctrine topics. Some of this stuff will look pretty tough at first, but that’s just because we’re taking your Symfony foo up to the next level. When you finish…

0:44
Adding Outside Bundles with Composer

…are dummy data we put into the database. When we started the project, we downloaded the Symfony Standard edition: our pre-started project that came with Symfony and other tools like Doctrine. Unfortunately, it didn't come with any tools for handling fixtures. But we…

4:36
Code Generation FTW!

…we need a CRUD for the Event entity. Want to use Doctrine to generate a CRUD? Yea, there's a console command for that doctrine:generate:crud: php app/console doctrine:generate:crud This inquisitive command first wants to know which entity we need a…

5:25
Inserting and Querying Data

…the error straight from MySQL saying that the details column can't be null. SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'details' cannot be null So Doctrine assumes by default that all of your columns should be set to NOT NULL when creating the table…

6:57
Translatable Mapping

…and slick approach is to use PHP attributes. I'm all for slick and modern, so let's go with attributes. These will be similar to these Doctrine ORM mapping attributes. Ours will map translatable entities and properties. In our object-translation-bundle/src directory…

5:19
MakerBundle & Autoconfiguration

…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 build our own new…

4:27
Extending with Events

…it says "Updated By", "Null". Our goal is to set that field automatically when a question is updated. A great solution for this would be to use the doctrine extensions library and its "blameable" feature. Then, no matter where this entity is updated - inside the…

8:03
AMQP Priority Exchange

…in different "queues". Then we can instruct our worker to first read all messages from whatever queue async_priority_high is bound to before reading messages from whatever queue the async transport is bound to. This did work before with Doctrine, thanks to this queue…

7:15
Partial Handler Failures & Advanced Routing

…there's a problem removing this ImagePost from the database, Doctrine will throw an exception right here and the file will never be deleted. That's perfect: the row in the database and file on the filesystem will both remain. But if deleting the row…

4:35
Inserting into a ManyToMany

…best superhero of all time? Um, I mean, how can we insert things into this join table? How can we join a Genus and a User together? Doctrine makes this easy... and yet... at the same time... kind of confusing! First, you need to completely…

5:27
OneToMany: Inverse Side of the Relation

…can think about any relationship in two directions: each GenusNote has one Genus. Or, each Genus has many GenusNote. And in Doctrine, you can map just one side of a relationship, or both. Let me show you. Open Genus and add a new $notes property…

5:08
Starting in Symfony2: Course 1 (2.4+)

…from the ground-up, touching on and discussing the most fundamental parts of the application. Specifically, we'll cover: Installation, Git and Setup Composer Routing Controllers Introduction to the service container Twig Doctrine Server setup Code generation Fixtures & external libraries And other tips and tricks

17 videos
|
1:18:05
Joining Across a ManyToMany

…Behind the scenes, to get this data, Doctrine will need to query across the join table and the tag table. But... we don't really care about that! We just get to say question.tags and that returns all the Tag objects for this Question…

5:22
Joining Across a Relationship & The N + 1 Problem

…text. The moment we do that, Doctrine makes a second query from the question table to get that answer's question data: so in this case WHERE id = 463. Then we render the second answer... and make another query to get its question data..…

6:30
Rendering Answer Data & Saving Votes

…templates/question/show.html.twig. If you scroll down a bit - here it is - we loop over the answers variable. That will still work: the Doctrine collection is something that we can loop over. But the answer variable will now be an Answer object. So…

6:02
The ManyToOne Relation

…want to do is relate an Answer to a Question. To do this... well... forget about Doctrine for a second. Let's just think about how this would look in a database. So: each answer belongs to a single question. We would normally model this…

8:35