PHPUnit No such file or directory
I'm trying to test my RoomRepository with PHPUnit and Symfony 4. I installed symfony/phpunit-bridge using composer. I created a simple entity called Room with one id and name attributs and a repository...
View ArticleSymfony wildcard host route with no named parameter
I want to host 2 different domains inside a single Symfony 4 application, so I'm using @Route's host parameter to declare the domain each page belongs to:/** * @Route("/foo", name="foo",...
View ArticleHow to generate entity and repository from an existing database? [duplicate]
This question already has an answer here:Symfony2s doctrine:generate:entities doesn't generate repo classes 6 answersI already have a database created. Now I need to generate the entities from this...
View ArticleConfigure a default host for routes in Symfony 4
So far my Symfony app was hosting a single domain. Now, I need to host a few pages on another domain. For business reasons, this must appear as a separate domain to the user, even though it actually...
View ArticleAlice Fixtures for Nested Set Tree Entity
I'm upgrading:hautelook/alice-bundle v1.4.1 -> v2.5.1 doctrine/doctrine-fixtures-bundle v2.4.1 -> 3.3.0 theofidry/alice-data-fixtures -> v1.1.2 I have a Group entity, which is setup as a...
View ArticlePHP - Convert base64 file content to PDF
I have an API in Symfony and a front with React. I'm trying to upload documents (jpg, png or pdf) but I only want to store pdf file in my directory. So, when a user send an image, i want to convert it...
View ArticleSymfony 4 Warning: filemtime() [closed]
it's an update form, if i try to update the first time it works but the second time i got this error:Warning: filemtime(): stat failed for...
View Articlesymfony annotations access to another field
I wanna have a start date and end date field in the database, but start date cant be greater than end date (logically) but is there any way to use Entity to make a comparison (with Assert/Constraints)...
View ArticleSymfony 4 - Customizing form error messages
I have a simple form on my website. The submitting and database entry works perfectly, but the problem is the error message display, I want to use two ways, not sure if they also work together.I want...
View ArticleHow to write a query with multiple where condition and IN condition?
I have a query from single table with multiple where condition, IN condition and order by condition. Basically, my query is like this.SELECT DISTINCT name, model, plattform FROM customer WHERE model...
View ArticleAttempted to call function "yaml_parse_file" from the global namespace
I am new to Symfony, Facing problem while trying to run the cron job. I am really clueless, whats wrong here. It seems that I am trying to access some functions present in app/config/functions.php from...
View ArticleSymfony 4 - Cannot create an instance of DateTime from serialized data
I want to persist some Json data in a entity with Symfony 4.3. As example, I usually do this :public function storeMetadata(EncoderInterface $encoders, ObjectNormalizer $normalizers,...
View ArticleSymfony Warning: filemtime(): stat failed
it's an update form, if i try to update the first time it works but the second time i got this error:Warning: filemtime(): stat failed for...
View ArticleSymfony 4 : "must implement interface DateTimeInterface" Error
I'm creating an admin with easy admin bundle, i'm really new to Symfony4.I've a button "create a category" and when i click on it, I've this error :Return value of App\Entity\Category::getCreatedAt()...
View ArticleHow to handle i18n translations with API first architecture?
With I18n enabled app, Front handles its own translations, so with API, what is best suited:1) API gives all system message as key e.g. email_invalid, firstname_required etc... and then front should...
View ArticleProblème de mise en place base de donnée sqlite [closed]
Bonjour,en faite j'ai un problème avec symfony 4.4 pour remplacer la base de donnée mysql par sqlite , et donc en faite j'ai déja fait des recherches sur le sujet et donc j'ai déja fait certaine choses...
View ArticleNotice: Array to string conversion in Symfony
I have problem with my code. I have entity<?php namespace CP\API\Entity; use CP\Model\Configuration; use CP\Model\Content; use CP\Model\Language; use CP\Model\MenuTranslation; use...
View ArticleHow to use conditionType 'ON' with Doctrine?
I have an issue with Doctrine concerning the condition ON. I have read here that:Now in doctrine 2 I have never seen a situation where ON can be used. In fact using ON always ends up in an exception...
View ArticleSymfony 4 : ADD SQLITE DATABASE
I have a problem with symfony to replace the mysql database with sqlite, and so actually I've already done some research on the subject and so I've already done some things like : change the database...
View ArticleHow to solve error An exception occurred in driver: SQLSTATE[HY000] [2002]...
My symfony project is working fine on localhost . i am able to connect to amazon aws rds on localhost .I have set mysql configuration in .env file of the symfony project . when i have uploaded/deployed...
View Article