Most voted "doctrine" questions
Doctrine is an Object-Relational Mapping (or ORM) framework for PHP. The ORM is a development technique used to reduce the impedance of object-oriented programming using relational databases. The database tables are represented through classes and the records of each table are represented as instances of the corresponding classes.
Learn more…95 questions
Sort by count of
-
1
votes1
answer55
viewsLaravel date error
I’m trying to bring the values of the database and present on the screen though he gives me the following error message: ErrorException in helpers.php line 531: htmlentities() expects parameter 1 to…
-
1
votes1
answer239
viewsGood Practice in APIS Rest Full with PHP and Doctrine ORM 2
Currently we have a system that uses Doctrine ORM2, we have our Entities, and themes our DAOS, within our DAOS classes we have several methods that we use to make queries, Change, Insert and Delete…
-
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
votes1
answer136
viewsHow to configure the pdo_mysql driver in Laravel 6
Laraveldoctrine ORM Exceptions Drivernotfound : Driver [pdo_mysql] not supported. My database.php configuration file is as follows: 'mysql' => [ 'driver' => 'pdo_mysql', 'url' =>…
-
0
votes1
answer845
viewsZF2 + Doctrine: generate entities returns 'no Metadata classes to process'
Good morning. In my project, I tend to create entities from the database (php5.4 + zf2 + Doctrine). I’ve circled the command below: bin/doctrine-module orm:convert-mapping --filter="Category"…
-
0
votes1
answer83
viewsProblems persisting data in Doctrine
I am doing this: function Autenticar($objecto) { //require $this->db; require ROOT . "config/bootstrap.php"; return $entityManager->getRepository('models\Usuarios')->findOneBy(array('login'…
-
0
votes1
answer473
viewsRelationship in the Doctrine
I have a problem that is analogous to the following situation: A car may or may not have a driver, or a car may have at least 0 and at most 1 driver. A driver may or may not have a car, ie a driver…
-
0
votes1
answer237
viewsDoctrine Insert regarding Many-to-Many unidirectional
I have the following situation: In my Local entity: /** * @ORM\ManyToMany(targetEntity="Contato") * @ORM\JoinTable(name="contato_localidade", * joinColumns={@ORM\JoinColumn(name="localidade_id",…
-
0
votes1
answer536
viewsPick up form value
This is my Twig form. <form id="csv" action="{{ path('faturamento_csv') }}" method="post"> {% for elm, value in filtroLocais %} <input type="hidden" name="{{ elm }}" value="{{ value }}">…
-
0
votes2
answers142
viewscurrent_date Doctrine
Bye, i’m wanting to bring the bank information only when it has the same day as today I tried those ways: ... ->where('a.data_hora = ?', current_date()); .... ->where('a.data_hora =…
-
0
votes1
answer131
viewsDoctrine’s findAll method returns the same id on all lines
I am doing a search that returns all the data of my Entity., it happens that it returns me all the data but with the same id, but I checked the database the ids are different..…
-
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
answer767
viewsfindBy() all records with two conditions
I’m trying to work with findBy() in an application made in Symfony2. I would like to put two conditions on Findby or mix with Where if possible, but am not getting. $properties =…
-
0
votes1
answer40
viewsDoubt Distinct with Doctrine_query
I have a table in mysql and I need to return unique values of this table only I am not able to create a Function or a query that adapts. The SQL statement in the bank would be like this and works…
-
0
votes1
answer155
viewsCount records in Doctrine
I need to return the total number of records from a table field, and also count the number of records from a given id. I need to count the data from a poll vote table so I need to count the values…
-
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
answer591
viewsHow to optimize memory consumption using Doctrine
I need to read and save in the database two files the first (smallest) has about 49,000 lines (each line will be become a record). I parse this file by creating an instance for the object and then…
-
0
votes1
answer175
viewsQuery with json type field in Doctrine 2 and Symfony 3
Does anyone know a way to perform a query using Doctrine which has a JSON field? Example query in Postgresql: select id, nome, tipo, '{"idUsuario":465,"login":"paulo"}'::json from public.usuarios…
-
0
votes1
answer68
viewsZend 2 "getServiceLocator" was not found
Every time I need to call the Doctrine ORM I find the error A plugin by the name "getServiceLocator" was not found in the plugin manager Zend Mvc Controller Pluginmanager How do I fix it ?…
-
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
votes2
answers690
viewsSQLSTATE[42703]: Undefined column: 7 ERROR: column Alis.column name_column does not exist LINE 1:
I have a page on my system that does a file transfer, it just does an update on the table. I copied the lines of this code and put it to work on another page, changing only the names of fields and…
-
0
votes1
answer44
viewsHow to use Datafixtureloader
I’m basing myself on this tutorial, but I have the Country and State classes. I’m trying to import the data using the command: php console doctrine:fixtures:load when I execute him works for the…
-
0
votes1
answer126
viewsError using Doctrine installed via Poser
I installed Doctrine via Poser: { "require": { "doctrine/common": "2.4.*", "doctrine/dbal": "2.4.*", "doctrine/orm": "2.4.*", "phpunit/phpunit": "3.7.*" } } When running unit tests, the file…
-
0
votes1
answer440
viewsPrint an array with multiple select data, once
I have a array which receives precisely 18 values. Each "key" of that array is a time and each value of this is an SQL query. I pass this array for a json file to bring the data objects I need. The…
-
0
votes1
answer42
viewsFailed to execute git status when updating Doctrine
I’m servicing a system, and I need to upload some changes to the production server. Some of these changes involve mapping and adding new entities to the bank. The problem: the file .…
-
0
votes1
answer61
viewshow to prevent sql Injection symfony 1.4 and Doctrine 1.2?
Hi, I have a 3 research inputs that query the database and return me the obtained data. With this a malicious user can bypass my system and get other information. Analyzing the behavior I use for…
-
0
votes1
answer58
viewsSerialize Relationships Doctrine
How do I do a json with Entity relationships in Doctrine? I’ve looked around and made a few attempts but nothing that has worked so far. I’m doing so and returns the normal json(without the…
-
0
votes2
answers57
viewsUsing Innerjoin with Limit
I have the table A with a relationship OneToMany with the table B. The table A is small, has 10 records. The table B has N records for each record in the table A. From X to X minutes a script is…
-
0
votes1
answer52
viewsError changing table via Doctrine Migrations
Through git I used the command below: php bin/console doctrine:migrations:generate I opened the file and made the change <?php namespace Application\Migrations; use…
-
0
votes1
answer78
viewsPHP and Javascript - Adjusting Mysql Table Search (Doctrine Query)
I’m doing on my client page, which I took over from another developer, a section to search for events registered in the Mysql database. How is that page: <div id="detalhesBusca"…
-
0
votes0
answers41
viewsSpecify table name using namespace in createQuery in Doctrine
I need to create a database query in a table whose name is order and that cannot be changed. I made the following query: $query = $entityManager->createQuery("SELECT sum(o.orderPrice) FROM…
-
0
votes0
answers35
viewsNested entities / nested list in Doctrine
I have two tables Plate and Candidate with similar structure: TABLE Chapa ( id INT AUTO_INCREMENT NOT NULL, PRIMARY KEY(id) ) TABLE Candidato ( id INT AUTO_INCREMENT NOT NULL, chapa_id INT DEFAULT…
-
0
votes0
answers22
viewsTriger after update as a solution to debit credits safely
I need to make an interface that guarantees the integrity of the customer’s credit. In PHP, when we use LOCK explicitly in PDO, with LOCK TABLES, when dealing there may be inconsistency, when the…
-
0
votes1
answer598
viewsHow to create entities with composite key in Doctrine?
I have a database that works with composite keys, and I am implementing the use of laravel framework. This is my bank’s structure: I’m using the Doctrine as ORM and discovered that I can not…
-
0
votes1
answer73
viewsSave user id automatically to entities with Doctrine
I use Doctrine 2 to map my system’s database. Most entities have a foreign key pointing to an entity "account". When a user logs into the system, I add their account id to a session variable. Then I…
-
0
votes1
answer1165
viewsphp function calling return from another function
Hi, I’m new to PHP OO and in the Doctrine. I would like to return the value of a function within another function. Is it possible? Both are within the same class. Function that will receive the…
-
0
votes1
answer1670
viewsLaravel only informs current date
Hello, I’m informing on Construct of my entity the date as follows: Entity: public function __construct($fornecedor, $emissao, $vencimento) { $this->fornecedor = $fornecedor; $this->emissao =…
-
0
votes1
answer60
viewsDoesn’t Doctrine ORM 2 have support for working with VIEWS?
I created a View in the database and now I need to use it in the system, but I can not use it, because the Doctrine à recognizes as a table, the following error appears: Type:…
-
0
votes1
answer37
viewsSeeking null value with get in the Doctrine Entity
Opa all right? I have a problem with values NULL with Doctrine. What happens: I have some fields in a database table where I keep some values for future validations, these fields are nullable =…
-
0
votes1
answer38
viewsDQL query using oneToMany in WHERE
This query does not work: public function getByUnidadeAnoSemestre(int $unidadeId, int $ano, int $semestre) : array { $query = $this->em->createQuery( 'SELECT s,u,p FROM ' . Servico::class . '…
-
0
votes0
answers18
viewsHow to disable the Doctrine shipment in the deserialization?
I use the JMSSerializerBundle (jms/serializer-Bundle) to make data serialization and deserialization, recently updated the project now when deserialize the object is already loaded by Doctrine,…
-
-1
votes1
answer93
viewsHow to customize the Doctrine library to work with the Timestamp type
I’m using Composer with Doctrine in my application, and it’s getting wonderful. But I need to customize some Doctrine features, changing the classes Doctrine\DBAL\Platforms\AbstractPlatform and…
-
-1
votes1
answer14
viewsSymfony Leftjoin createQueryBuilder Error
I’m trying to run this query, My relationship is not explicit between Customer and Competitor; I’m getting this error, that I can’t get details of what’s going on, I can’t get the…
-
-2
votes1
answer36
viewsCheck if there are active products in this brand, if not, show brand
I have two tables in my bank, adm_marca and adm_produto, at the moment, is showing in my view all brands, regardless if there are active products or not, I need to show only brands that do not have…