doctrine Questions

3

I'm using Laravel and I just added a new migration for increasing column size. The first generated table has a column named latlong of type Point. I can't modify any column size? When I try to modi...
Bookcraft asked 25/11, 2017 at 9:57

3

Solved

I'm running PHPStan on a Symfony project where I have the following relation in a Doctrine entity: /** * @ORM\OneToMany(targetEntity="App\Entity\Course\Slide", mappedBy="chapter", cascade={"persi...
Ermine asked 24/4, 2020 at 22:15

5

i want to use Rector for refactoring my code because i update my project to symfony 5.4 to 6.1. My php project version : 8.1.5 So, i want to use a simple rule who change my annotation to attribut w...
Unroof asked 3/8, 2022 at 10:9

3

When I try to run doctrine:schema:update --complete --dump-sql on a Symfony dockerized application, the output is showing below: ALTER TABLE offer DROP FOREIGN KEY FK_29D6873EC1EA42F3; DROP TABLE d...
Dropsical asked 16/2, 2023 at 6:15

4

I have a console application with Symfony 2, the script run on cron (terminal). But, after \Doctrine\DBAL\DBALException the script throw N \Doctrine\ORM\ORMException with message "The EntityManager...
Weaponeer asked 26/11, 2014 at 15:30

2

Solved

I'm trying to update to Symfony 7.0. So far the update was successful. Now, when I try to call one of my endpoints I get the following error: "Ignore on \"Proxies\\__CG__\\App\\Entity\\Ro...
Prearrange asked 6/4, 2024 at 17:45

6

Solved

I'm using Doctrine 2 where I have multiple connections for DBAL. I have also multiple EntityManagers in ORM. I need to be able to somehow autowire specific DBAL connection into other Symfony 3 se...
Birkle asked 15/9, 2017 at 8:43

7

Solved

So I have a Symfony 6.2 API, PHP 8.2 codebase. While trying to run composer install/update the following error is displaying and I'm wondering how to clear it: In CheckExceptionOnInvalidReferenceBe...
Pressey asked 2/1, 2023 at 16:40

2

Solved

I have read the docs about lifecycle events, and several questions here on SO about changing or persisting new entities during lifecycle events. Calling EnitityManager::flush() seems to be a proble...
Hispid asked 22/9, 2018 at 20:9

5

Solved

Let's say I have entity $e. Is there any generic way to store it as another row, which would have the same entity data but another primary key? Why I need this: I'm implementing some sort of Tempo...
Continue asked 30/1, 2012 at 21:34

3

Solved

I've done something horribly wrong to my migration_versions, deleted the versions from the migrations folder now and I get this error when try to run anything to do with migrations. Could someone p...
Moonstruck asked 17/4, 2020 at 1:9

2

I have created a fresh Symfony project and I keep getting this "DoctrineMigrationsBundle requires DoctrineBundle to be enabled." error and cant get rid of it. Apparently I'm the only one ...
Marrs asked 27/9, 2021 at 14:5

2

Solved

I am starting a new project using Symfony 4 + Flex. At this time I'm trying to connect my new app to a MySQL database. I'm following the Symfony Documentation, and I have already add doctrine to my...
Barahona asked 15/5, 2018 at 9:20

3

So I'm setting up a Symfony 5 project and running the following commands to generate the database from entity annotations like this: php bin/console doctrine:schema:validate php bin/console doctrin...
Feasible asked 12/12, 2020 at 19:36

4

Solved

I am using PHP8, symfony5 and doctrine2 with phpstan and getting these errors: Property App\Entity\User::$id is never written, only read. The code: <?php namespace App\Entity; use App\Reposi...
Rema asked 5/11, 2021 at 10:4

7

Solved

I need to know the database name and database server name inside a symfony project. How can one access the current database connection settings programmatically in symfony (using Doctrine)?
Primeval asked 16/5, 2011 at 0:7

3

Solved

How can i set the name of the foreign key (edit: not the name of the attribute itself) for the many-to-one relation "region" using YAML? SWA\TestBundle\Entity\Province: type: entity table: provi...
Blip asked 2/10, 2011 at 0:59

4

Solved

let's say I have 3 databases: prefix_db1 prefix_db2 prefix_db3 And I want to connect to them dynamically from the url like this http://localhost/my-project/web/app_dev.php/db1/books so I kno...
Encouragement asked 5/11, 2018 at 9:34

3

The error Cannot delete or update a parent row: a foreign key constraint fails. The classes class Teacher { /** *@ORM\OneToMany(targetEntity="publication", mappedBy="teacher") */ protected ...
Biddable asked 13/1, 2012 at 23:29

3

Solved

I'm using doctrine DBAL and have some problem with SQL query as result of a queryBuilder. $builder = $this->getConnection()->getQueryBuilder(); $builder->select(['id','name','type']) -&g...
Coth asked 6/7, 2015 at 10:6

21

Solved

We're using Doctrine, a PHP ORM. I am creating a query like this: $q = Doctrine_Query::create()->select('id')->from('MyTable'); and then in the function I'm adding in various where clauses...
Lauer asked 19/1, 2010 at 17:15

4

Solved

Situation: I want to use the getReference() function of doctrine2 Entity Manager. However, in a situation where I ask for an object that has been deleted from the database, I obtain a proxy if I a...
Stickleback asked 9/5, 2013 at 6:51

8

Solved

I need to clear my doctrine's cache in Symfony. There must be some way in command line for clear the cache. Or where should I find and delete the files belonging to cache?
Mccaleb asked 6/8, 2012 at 10:24

5

Solved

I have a doctrine query that returns blog posts and their comments: SELECT b, c FROM BlogPost b LEFT JOIN b.comments c I would like to limit the results to 10 blog posts. According to the DQL do...
Rochellerochemont asked 11/4, 2011 at 11:45

4

Solved

I've research this a great deal and I'm sure the answer is no, but I'd love to proven wrong. I'd like to execute a query written in DQL that contains the REGEXP operation. For example: select * f...
Marathon asked 10/1, 2012 at 21:0

© 2022 - 2025 — McMap. All rights reserved.