Questions tagged [Doctrine ORM] (413)

1
answer

Symfony 4 — How to solve the problem with the Entity in the Bundle?

Hi all, There is a challenge wanted to create a Symfony Bundle. For example, Bundle animals, there is the substance of Animals. This bundle should work in different projects. In one project the essence of the Animals in itself, in other projects the essence of Animals should have different associations and relationship M...
krystina.Conn asked April 19th 20 at 12:38
1
answer

Symfony 3.4 — how to write a Listener that is called only when writing changes to the Database?

Hi All, how to write a Listener that is called only when recording changes in the Database. It is necessary to intercept and modify, but only when there is Update in the database. not in the Insert
itzel_Kreiger40 asked April 19th 20 at 12:05
2
answers

Like in Symfony to add a repository from the bundle?

Tried to identify common code in a separate bundle. Got there and the Entity with Repository entity repository implements "Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepositoryInterface", but its service could not be found. Make sure the service exists and is tagged with "doctrine.repository_service". If for e...
Ila.Harb asked April 16th 20 at 11:03
1
answer

Like in symfony to access the database from a static class?

I created a static class within Symfony (without the dependencies of the Symphony) and want to work in it with a database, using Doctrine. Also I have a entity table in the database and the repository for this Entity. As I understand it, I don't have enough ContainerInterface, which is automatically generated by Symfony co...
skye.Casp asked April 8th 20 at 18:20
1
answer

How to force doctrine to see the fields in the jointable?

There are 2 entities. City and Service. In Service: /** * @var ArrayCollection * @ORM\ManyToMany(targetEntity="AppBundle\Entity\City", inversedBy="services") * @ORM\JoinTable( * name="city_service_rel", * joinColumns={@ORM\JoinColumn(name="service_id", referencedColumnName="id", onDelete="CASCADE")}, * inverseJoinColu...
julie_Baumbach asked April 8th 20 at 17:14
3
answers

How to reset or merge migrate and leave one?

Welcome! There is a project on symfony4 + mysql It has a standard folder migrations Migrations Migrations themselves have a lot, a few dozen. How to make only one migration, from zero to the last current state? It does not lose information.
Ernestina.Rodrigu asked April 8th 20 at 17:12
0
answer

How to disable lazy initialization of entities in Doctrine for the current request?

All kind time of day. Today encountered the following very strange problem. What is available: PHP on Windows 7 x64, version 5.3.17, Apache version 2.4 (at work 2.2), PHP is connected as a module. Symfony version 2.0.16, Doctrine version 2.1. Was created to test three tables - a, b, and a_bstoring communication "many-to-...
alden_Kshlerin53 asked April 8th 20 at 10:10
1
answer

How to disable inheritance in Doctrine?

How to turn off inheritance in doctrine? That is, that the doctrina was not checked mapping and worked with these classes as regular classes without extends. The inheritance in this situation, I only need to derive some methods that I don't want to be called directly from the parent. UPD: I have tried to use the approach ...
jadon_OConnell asked April 8th 20 at 10:03
0
answer

Event for the entity before updating it?

The task is simple: before you upgrade the entity to invoke the method. Upon initial save, the event fires prePersist Subsequent persist no channel, stated Yves documentation prePersist - The prePersist event occurs for a given entity before the respective EntityManager persist operation for that entity is executed. It sho...
Elias.Schmeler asked April 8th 20 at 09:36
0
answer

How to pull multiple values in one query?

The question is probably incorrectly formulated, but I do not understand from what side to approach him in one table there are multiple values with an ID-kami categories although different fields have essence but categories are in one table I made a crutch, but I understand that it is not very blunt - I don't know how to o...
octavia asked April 8th 20 at 02:08