Users Need Passwords plainPassword
... text password, encrypt it through the
bcrypt algorithm and store that on the password property.
How? The best way is to set the plain-text password on the User and encode it automatically
via a Doctrine listener when it ...
Creating an Entity Class
Doctrine is an ORM, or object relational mapper. A fancy term for a pretty cool
idea. It means that each table in the database will have a corresponding class
in our code. So if we want to create an article table, it ...
Optimizing with Cache
... the provision started - use playbook.yml and add -l aws to only provision
the aws host:
Use beefpass for the password.
There's one other way we can boost performance. Open app/config/config_prod.yml:
See those Doctrine ...
Inserting new Objects
... on that object, and tell Doctrine to save it:
Doctrine wants you to stop thinking about queries, and instead think about objects.
Right now... name is the only real field we have. And it's a private property, so
we ...
Query across a JOIN and Love it
What about a JOIN query with Doctrine? Well, they're really cool.
Here's our last challenge. Go to /genus. Right now, this list is ordered by the
speciesCount property. Instead, I want to order by which genus has the ...
ManyToMany Relationship
... ManyToOne, we just need an annotation that tells
Doctrine what type of association this is and what entity it relates to:
// src/Yoda/EventBundle/Entity/Event.php
// ...
/**
@ORM\ManyToMany(targetEntity="Yoda\UserBundle ...
Starting in Symfony2 Course 2 2.4
Over the next hour, we're going to take you through some of the most difficult areas of Symfony learning all about security, forms, and parts of Doctrine. We'll also see testing and learn more about how Symfony's ...
Joining Across a Relationship The N 1 Problem
... time
we render an answer, we also render that answer's question 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 ...
Fetching Relations
... object. Remember: by this point, Doctrine has already used
the slug in the URL to query for the Question object.
The important thing here is that, when we call findBy(), we don't
say 'question_id' => $question... or ...
Saving Entities
Put on your publishing hat, because it's time to write some thoughtful space articles
and insert some rows into our article table! And, good news! This is probably one
of the easiest things to do in Doctrine.
Let's ...
Adding Property Types to Entities
A new feature snuck into Doctrine a while back, and it's super cool. Doctrine can
now guess some configuration about a property via its type. We'll start with
the relationship properties. But first, I want to make sure ...
Entity Class
Doctrine is an ORM: an object relational mapper. That's a fancy way of saying
that, for each table in the database, we will have a corresponding class in PHP.
And for each column on that table, there will be a property ...
Upgrading to Symfony 5.0
... We've done it! We fixed all the deprecations in our app... except for the
doctrine/persistence stuff, which we don't need to worry about because we're
not upgrading that library. That means... we are ready for Symfony5 ...
ManyToMany Relationship
... table, with genus_id
and user_id foreign keys. That isn't a Doctrine thing, that's just how it's done.
So how do we setup this relationship in Doctrine? It's really nice! First, choose
either entity: Genus or User, I ...
OneToMany Inverse Side of the Relation
... ManyToOne
and ManyToMany. For this, we needed ManyToOne.
But actually, you 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 ...
Upgrading to Symfony 7
... directly in our composer.json file. Proxies are
something that Doctrine uses behind the scenes to load lazy relationships. Recently,
Symfony added its own version of proxies called "ghost objects". They're spooky
cool. Anyway ...
Final Upgrades Cleanups
... need to update. As I mentioned,
we're going to ignore knplabs/knp-markdown-bundle. But if you have that in a
real project, refactor it to use twig/markdown-extra.
What I'm interested in is doctrine/dbal, which has a new ...
DQL The Query Builder
We just learned that when you ask for a repository, what you actually
get back is a custom class. Well, technically you don't have to have a custom
repository class - and if you don't, Doctrine will just give you an ...
AMQP with RabbitMQ
Open up your .env file and check out the MESSENGER_TRANSPORT_DSN setting.
We've been using the doctrine transport type. The doctrine://default string
says that messages should be stored using Doctrine's default ...
2710
Doctrine
Filter Results