1000 search results

Annotations to Attributes

…re back! With just a few commands we've converted our entire site from annotations to attributes. Woo! Next, let's add property types to our entities. That's going to allow us to have less entity config thanks to a new feature in Doctrine.

5:14
Search, the Request Object & OR Query Logic

…we were already filtering WHERE status = approved. But because we put the OR statement inside of the andWhere(), Doctrine surrounded the entire fuzzy search part with parentheses. If we had used orWhere(), that wouldn't have happened... and our query logic would have been…

8:05
Themed Pagination Links

…cool! Ok team! Congratulations on finishing both Doctrine courses! Big team high five! Doctrine is one of the most important parts of Symfony and it will unlock you for almost anything else you do. So let us know what cool stuff you're building and…

7:07
Entity objects in Twig

…most recent requests we've made. Here's the one we just made to /questions/new. Click the little token string on the right to jump into the full profiler for that request! Go to the "Doctrine" tab and... bam! Cool! It even wraps the…

4:55
Composer

doctrine/dbal package and added it. With the require command, you can search for the package you need and Composer will automatically update your composer.json for you and run the update command to download the library. In this case, when I included the doctrine

14:00
Removing Items from a Collection

…the $cheeseListings property, add orphanRemoval=true. This means, if any of the CheeseListings in this array suddenly... are not in this array, Doctrine will delete them. Just, realize that if you try to reassign a CheeseListing to another User, it will still delete that CheeseListing. So…

5:29
Creating the User Entity

…make:migration Move over... and double-check the SQL: CREATE TABLE user - looks good! Run it with: php bin/console doctrine:migration:migrate Perfect! We have a gorgeous new Doctrine entity... but as far as API Platform is concerned, we still only have one API…

5:07
Serialization Groups

…false. By the way, if you're using Symfony 4.3, instead of a Doctrine error, you may have gotten a validation error. That's due to a new feature where Doctrine database constraints can automatically be used to add validation. So, if you see…

9:34
@SerializedName & Constructor Args

…Symfony 4.3, you may already see a validation error! That's because of a new feature that can automatically convert your database rules - the fact that we've told Doctrine that title is required in the database - into validation rules. Fun fact, this feature…

7:15
Listening to LemonSqueezy Javascript Events

…hit. So... did this work? At your terminal, check the database with: bin/console doctrine:query:sql "SELECT * FROM user" It didn't! It says that the lsCustomerId value is "undefined". Hmmm, sounds like we're using a bad path for the customer ID. If…

7:29
Upgrading to Symfony 6.0

…? 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 a situation where you need to find the GitHub page for the library…

7:07
ManyToMany Relation

…that Doctrine is going to handle the heavy lifting of inserting and removing records to and from this table for us. We'll see that in a minute. But before I forget, head back to your terminal and run this migration: symfony console doctrine:migrations…

4:53
Using API Platform to build ticketing system (Antonio Peric-Mazar)

…can, I can change it. What you can use, it's actually Doctrine User Provider which is included in Symfony 4 so it's simple and easy to integrate. Then you need to, only thing that you need to do is bin/console maker:user…

38:25
Logging in Inside the Test

…ids. Try this: $em = self::$container - a parent class sets the container on this nice property - ->get() and the service id. Use doctrine then say ->getManager(). You can also use the type-hint you use for autowiring as the service id. In other words…

6:57
Unique (but not Insane) Filenames

…But if you want to guarantee cleaner filenames, there's an easy way to do that. I'll use a class called Urlizer: this comes from the gedmo/doctrine-extensions library. It has a nice method called urlize() and we can wrap our $originalFilename in…

6:30
Security & the User Class

…for now. We will add a password later, but we'll keep things extra simple to start. And... we're done! Awesome! This created a User entity, a Doctrine UserRepository for it, and updated the security.yaml file. Let's check out these changes next!

6:30
The POST Create API

…just simpler if you can update the state immediately. And that is why UUID's can be awesome. If you configure your Doctrine entities to use UUID's instead of auto-increment ids, you can generate valid UUID's in JavaScript, update the state immediately…

9:04
API Pagination Done Easily

…m just trying to keep things simple. If I were doing this in a real project, I'd probably use a library called Pagerfanta. It helps you paginate and has built-in adapters already for Doctrine, and Elastic Search. You can give it things like…

8:48
Hello Layouts+ Setup!

…putting into them. We'll see all of that in the Layouts admin section in a minute. To add the needed tables, scroll up and copy this nifty doctrine:migrations:migrate line. This is kind of cool. The layouts packages comes with migrations... and this…

7:30
Database Tricks on SymfonyCloud

…main php bin/console doctrine:fixtures:load Ok, let's break this down. First, there is actually a much easier way to do all of this... but I'll save that for some future SymfonyCloud tutorial. Basically, we're running the doctrine:fixtures:load command…

8:00