Most voted "doctrine-2" questions
Doctrine 2 is an Object-Relational Mapping Framework (or ORM) for PHP (5.3.2+). While Doctrine 1.2 uses the Active Record standard Doctrine 2 uses the Data Mapper standard. The Doctrine Project is a collection of open source libraries and tools to handle database abstraction and mapping of relational objects written in PHP.
Learn more…60 questions
Sort by count of
-
5
votes2
answers2069
viewsDoctrine: Manytomany’s Relationship with Extra Fields
I have a many to many relationship between two tables: Products and Orders. The Doctrine then generates a third table. So far quiet. But wanted to generate in this third table more fields (Qtde and…
-
4
votes1
answer159
viewsI cannot persist the data in the Bank
I think I’m doing something wrong in this class, because it is the only one of my system that is not persisting in the database. What am I forgetting to do to make it work? The method incluir()? If…
-
4
votes1
answer181
viewsHow to avoid duplication of content in a table without a primary key?
In a virtual shop panel I am building the products have relations by color and size, where each product color has a size. This is a part of my database to better understand the problem:…
-
3
votes0
answers98
viewsCodeigniter 2.2 and Doctrine 2
I have installed CI2, Doctrine 2 and HMVC. I followed the steps of this website except for Smarty that I didn’t find necessary. My folders are organized as follows: ->application ->cache…
-
3
votes1
answer132
viewsDoctrine ORM returning array[0] in find
I have a question. I implemented Doctrine with Silex, created the entity, the Repository and the service, but when it comes to doing a search with findByEmail() for example, to display the result I…
-
3
votes1
answer223
viewsWhat is the overhead when using Doctrine?
A few days ago I was discussing with some colleagues about performance and high availability. In the middle of the discussion one of the points raised was that when reaching a certain number of…
-
2
votes1
answer118
viewsDoctrine 2 - Entities in more than one directory
Good morning guys, I’m starting in Doctrine 2.4 and I’m developing a system where I separate files from the file core of the application, as follows: /root |-- /src |-- /App |-- /Model |--…
-
2
votes2
answers819
viewsHow to check if the date inside Datetime is invalid?
Work on an application with PHP 5.5 + Symfony 2 + Doctrine. In one of the tables of this application there is a field updated_at which is initially NULL. However, when I give one getUpdatedAt() in…
-
2
votes1
answer861
viewsDoctrine 2 - Does not recognize class mapped with $entityManager->getRepository()
Personal iae... In my file bootstrap.php I am trying to take the repository of a certain entity and gives Fatal Error, informing that the Class does not exist, but it does exist. Here is the error…
-
2
votes1
answer69
viewsReturn property in a Manytomany relationship
I have a relationship ManyToMany between 2 classes. Campannha and Empresa. A Annotation of the class Campanha is like this: /** * @ORM\ManyToMany( targetEntity="JN\Entity\Empresas\Empresa") *…
-
2
votes1
answer197
viewsEntity manager no definaty problems with Doctrine
I’m having trouble with Doctrine when I try to generate entities it sends me a message saying **[InvalidArgumentException] The helper "em" is not defined.** my configuration file is set this way //…
-
2
votes1
answer656
viewsDoctrine 2 INNER JOIN with Subquery
I’m migrating my appointments to Doctrine using the Querybuilder. And I have a consultation with Inner Join with a subquery, would like to know how to do this using Doctrine. SELECT p.* FROM…
-
2
votes1
answer436
viewsSymfony Single id is not allowed on Composite Primary key in Entity
I have a view, where Mapeei 3 fields as primary key and 2 of these fields are foreign keys As below: /** * @var NotaFiscal * @ORM\Id * @ORM\ManyToOne(targetEntity="NotaFiscal", inversedBy="itens") *…
-
2
votes1
answer62
viewsHow to return a data collection using Doctrine Resultsetmapping?
I have the following script that is functional: SELECT r.coluna_1 as Coluna_1, e.coluna_1 as Coluna_2, FROM produto r INNER JOIN empresa e ON r.id_empresa = e.id_empresa WHERE r.id_tipo = 'N' AND…
-
1
votes1
answer108
viewsBlameable behavior does not work on Symfony2
I am implementing in Symfony2 the behavior Blameable using the Gedmo\Mapping\Annotation. I have successfully implemented the Timestampable, but I cannot implement the Blameable. The problem is that…
-
1
votes1
answer112
viewsSymfony2/Doctrine - Query Join with three different entities
The way below works correctly: $qb->select('partial t.{id,nsu,status,message}, partial u.{id,shortName,email} as user') ->from('GatewayBundle:Transaction', 't') ->join('GatewayBundle:User',…
-
1
votes1
answer111
viewsConvert SQL to DQL
Opa to all, I need to convert a SQL in DQL of Doctrine 2 if someone can help me thank you. SELECT produtos.id, produtos.categoria_id, produtos.nome, produtos.descricao, produtos.valor, (SELECT…
-
1
votes1
answer218
viewsHow to use Onupdate=Cascade in Doctrine 2
Personal I have a relationship of much for one in a table and I need to put the Onupdate in Cascade as I do because I try so of the error: /** * @ORM\ManyToOne(targetEntity="JN\Entity\Planos\Plano")…
doctrine-2asked 9 years, 10 months ago Joao Nivaldo 1,229 -
1
votes1
answer187
viewsDoubts in the creation of the relationship
Personal I have 2 classes, a call Venda and another ItensVenda. I need to create a relationship to: when I open a sale can see all the items of this sale. when I access an item of a sale I can see…
doctrine-2asked 9 years, 9 months ago Joao Nivaldo 1,229 -
1
votes1
answer307
viewsDoctrine - Access the $entityManager variable created in bootstrap.php from within a Class
I am studying Doctrine and am adapting a project I had already developed in MVC to work with Doctrine. I am having a certain doubt on how to proceed in relation to the variable $entityManager that I…
-
1
votes1
answer54
viewsHow to access the Sqls of the updates made by Doctrine Orm:schema?
I have an application running on a server (production) that does not give access to ../vendor/bin/doctrine and so I can’t run the commands, like the orm:schema-tool:update, for example. I am running…
-
1
votes1
answer443
viewsFilter tables to be mapped by Doctrine from Entitymanager (no command line)
I’m developing a feature in my application that consists of automatically mapping and generating entities. The problem is that the user can select the tables he wants to map, so I must insert a…
-
1
votes1
answer100
viewsDoctrine DQL with WHERE does not work
Good afternoon! I’m trying to perform a query in a table of users that has FK of 4 other tables, but I believe that is not the case, and perform 2 filters in WHERE, for example WHERE login =…
-
1
votes0
answers371
viewsHow do I use Doctrine’s Entity Generator?
I’m trying to use Doctrine on a project. however I am having difficulty in being able to use Entity Generator once the database is ready and would like Doctrine to create the entities from it.…
-
1
votes1
answer275
viewsORM Mapping error in Doctrine 2
I’m mapping the database with Doctrine and I’m having a problem. When I use the Annotations as follows it works perfectly: /** * @Entity *…
-
1
votes0
answers57
viewsDoctrine, error when generating proxy
I would like some help, I’m getting this mistake from time to time, I’ve researched a lot, but nothing that helps me solve. As I said, this error is not always returned. In this application I am…
-
1
votes2
answers255
viewsSelect repository-specific columns in Doctrine 2
First, we know that depending on the number of columns in a query, you can increase the response time. In Doctrine I call the following repository, which has a relationship and brings all the…
-
1
votes1
answer80
viewsInstantiation error 2 objects with Doctrine entities (Setter)
I am not managing to make the relationship of 2 entities and the following error is appearing: Catchable fatal error: Argument 1 passed to Clientes\Entity\Clientes::setEstado() must be an instance…
-
1
votes1
answer97
viewsCriteria query with contains expression in the Manytoone entity field
Considering the two entities below: /** * @ORM\Table(name="cliente") * @ORM\Entity */ class Cliente { /** * @ORM\Column(name="id_cliente", type="integer") * @ORM\Id *…
-
1
votes1
answer96
viewsSymfony2 - Updating an entity’s field when executing action in another entity’s Controller
I need to update the field budget of my entity Client when inserting new data into the table Budget. Both have relationship oneToMany and manyToOne, respectively. I received suggestions to use the…
-
1
votes0
answers57
viewsSymfony2 - Only one field has its value read, the others of this same field are NULL when submitting form
I have two related tables: material and items_budget. The table items_budget has a form that has a field that lists the name of all material in a group of checkbox, and next to each checkbox has two…
-
1
votes0
answers237
viewsA plugin by the name "getServiceLocator" was not found in the plugin manager Zend Mvc Controller Pluginmanager
I recently started learning Zend Framework2 from Angularjs through a course from the School of Net. Considering the year of the course, which if I’m not mistaken is 2013, some things have changed in…
-
1
votes1
answer84
viewsDoctrine prepare->execute
Hi, I’m doing this consultation with Doctrine $retorno = $em->getConnection()->prepare(" SELECT t.id_programa_fidelidade_diario, t.loja, t.nota, t.data, t.ecf, t.operador, o.nome,…
-
1
votes0
answers12
viewsWhy is the record removed when the Owner has been changed?
I created a method to alter the Owner of the records. $sql = "UPDATE Contato\Entity\Email t SET t.$column = :contato1 WHERE t.$column = :contato2"; $query =…
-
1
votes1
answer256
viewsHow to adjust Inner Join in Querybuilder?
Running this query directly in SQL works SELECT T2.id, T2.name, T2.description, T2.version, T2.img_thumb, T2.interval, T2.date_created, T1.id_app, T1.is_active FROM Categoria T1 INNER JOIN…
-
1
votes0
answers61
viewsSemantical Error The Annotation "@Symfony Component Validator Constraints Notblank " in Property was Never Imported
I am developing a simple API with Microframework Slim using Doctrine, I decided to implement some validations, so I installed the library symfony/validator:^5.2. In my entities, I have some Doctrine…
-
0
votes1
answer583
viewsDoctrine Date Format
I would like to format a date with Doctrine, often I save a date like datetime in the database but want to perform a search grouping per day without considering minutes and seconds. Does anyone know…
-
0
votes2
answers120
viewsHow to return only one column
People I have the following query made. $ent->createQueryBuilder('t') ->select('count(t.id)') ->join('t.categoria', 'c') ->join('t.noticia', 'n') ->groupBy('n.id')…
doctrine-2asked 9 years, 7 months ago Joao Nivaldo 1,229 -
0
votes1
answer89
viewsInsert multiple objects with Dbal Doctrine
I am using Silex in conjunction with Doctrine dbal 2.5. How do I insert multiple objects into the bank with dbal Doctrine? Reading the documentation I didn’t find anything that made it possible,…
-
0
votes1
answer421
viewsUpdate one entity after entering data into another
I urgently need to find some way to resolve this problem that has trapped me for over a week. Once solified, I believe I can use this medium to do other operations that my system will have. I have…
-
0
votes0
answers55
viewsZf2 and "Doctrine-module" return error: In Metadata Classes to process
I’m in trouble when I’m executing the following command on the terminal: vendor/bin/doctrine-module orm:convert-mapping --filter="Category" --from-database annotation…
-
0
votes1
answer220
viewsGetting Data from a Manytomany Relationship with Doctrine2
I have the following relationship N:N between teacher tables and classes, where there is a third teacher table. I want you to list the teachers and bring me all the classes this teacher teaches…
-
0
votes3
answers199
viewsHow to capture the result of an execution of doctrine2?
I am implementing Doctrine in a project, but I have a question about inserting, updating and removing data. When I run the following command for example: $companyName =…
-
0
votes1
answer39
viewsHow to use Filters in Doctrine?
I have the Entities that I did in Doctrine, and I also have the DAOS, which is where the. I have an API where the user may or may not use Query Parameters as follows:…
-
0
votes1
answer19
viewsUse Doctrine createQueryBuilder with tablets that have no entity
It is possible to perform a query with Doctrine createQueryBuilder using a table that does not have a declared entity (Entity)? Example: In the code below table table2 (t2) does not have an entity…
-
0
votes0
answers130
viewsDoctrine ORM: How to register several times in the same table using beginTransaction()
How do I register in the same database table using beginTransaction(). Example: Registering various details of a product $entityManager->getConnection()->beginTransaction(); try { ... //…
-
0
votes1
answer49
viewsInclusion of record in Manytoone with Doctrine
Opa to all of you, Personal have created entities a call Products and another call Categories they are related in type Manytoone with Doctrine. In case it would be several products for one category.…
-
0
votes1
answer56
viewsHow to do Innerjoin with related table?
Guys I got a class Arquivo who has a Manytoone relationship with a class Usuario working right. I need to list all the data that are in the class Arquivos including relationships. How I do that in…
doctrine-2asked 9 years, 9 months ago Joao Nivaldo 1,229 -
0
votes1
answer738
viewsError setting up Doctrine + Zend
Hello, I am trying to configure Doctrine ORM to work with Zend Framework, and when I give the command 'bin/Doctrine-module' appears the following error: PHP Fatal error: Uncaught exception…
-
0
votes1
answer350
viewsRecords being inserted in two tables between Entities with (Doctrine - Foreign Key)
I have two tables, one States and another Customers. When entering the records in the two tables, an error is occurring, instead of entering the state reference in the foreign key of the table…