Tag: doctrine
-
How to add a fulltext index in Doctrine with Symfony 5+
I had to google to find this answer on Stackexchange because I can’t find anything in the docs. Apparently this is something new so you don’t have to jump through the old circus hoops of the past. Apparently you can add a flags section like this to one of the index definitions of your Entity […]
-
How to access Doctrine in Symfony 5+ services
Scroll down to the answer part if you just want the answer. From what I can tell the Symfony documentation only shows how to access doctrine in your controllers( I am sure it is somewhere). But what if you need to access it in a service? Services are any class within a folder inside the […]
-
How to create 100+ Symfony 5+ Doctrine 2 or 3 Repositories
Scroll to the bottom to view a video of this Repository maker in action. I make about 100 Repositories in less than 2 minutes. You can go faster by just hitting enter really fast. LOL NOTE – repository in the sense of this article means a Doctrine Repository Object. This object is used to interact […]
-
how to fix doctrine symfony entity has a repositoryClass set to “entity name”, but this is not a valid class. Check your class naming
So you got this error while trying to access a repository from a Service or somewhere else. So what went wrong and what does this mean? Well it probably means that you did not use a fully qualified name for the repositoryClass statement or you do not have one at all. Basically Doctrine needs to […]
-
Tips and tricks to reverse engineer your existing database with Doctrine for Symfony
So in the Symfony documentation there is a page that describes how to reverse engineer an existing database using Doctrine. Rule #1 No DB Vendor custom types The only problem is this technique will only work with databases that are generically designed. Meaning you can’t use some of the DB vendor specific types etc. This […]
-
How to fix Unknown database type enum requested, Doctrine\DBAL\Platforms\MySQL80Platform may not support it.
So you got this lovely error when trying to reverse engineer a database with doctrine. This error means that your database uses ENUM and is probably running on MySQL. MySQL also contains SET which is about the same as ENUM except enum allows only 1 value from the list( or empty string or NULL) and […]
-
How to reverse engineer a database for a symfony project with doctrine… aka t_
TLDR This is a parody about how I learned to Reverse engineer a Database for a Symfony App with Doctrine. Here is a short article including tips and tricks I discovered I learned while writing this. This article jokes about some of what I ran into and what I was thinking while I learned Doctrine. […]
-
Using doctrine commands in the console with Symfony Framework
Here is the issue. If you follow along the docs for Doctrine when working on a Symfony framework, you will get issues every once and a while. ./vendor/bin/doctrine-migrations status –show-versions Something missing or not configured correctly etc. That line is copied and pasted directly from the Doctrine documentation . To use Doctrine this way with […]
-
How fix doctrine error : You are missing a “cli-config.php” or “config/cli-config.php” file in your project, which is required to get the Doctrine Console working.
So while following this guide in the documentation to try to reverse engineer my database with Doctrine, I got the following 100% absolutely nonsensical error Importing mapping information from “default” entity manager writing src/Entity/AffiliateArticleViews.php writing src/Entity/AffiliateJoinCounts.php writing src/Entity/AffiliateRegistration.php writing src/Entity/BlogMedia.php writing src/Entity/CommentReplyConclusionOptions.php writing src/Entity/CommentReplyReportReasons.php writing src/Entity/DoctrineMigrationVersions.php writing src/Entity/FavoredImages.phP In DebugClassLoader.php line 346: Warning: include(/var/www/sogi/sogizmo/vendor/composer/../../src/Entity/FavoredImages.php): failed […]
-
Doctrine migrations links
I have trouble navigating the Symfony documentation so I create lists of links here so I can just easily find what I need again later. MigrationsBundle link and info -> shows how to run migrations and all of the doctrine migration related commands Doctrine Symfony overview -> more information about doctrine and migrations.