Questions tagged as 'doctrine-2'

1
answer

Return property in a ManyToMany relationship

I have a ManyToMany relationship between 2 classes. Campannha and Empresa . Annotation of class Campanha looks like this: /** * @ORM\ManyToMany( targetEntity="JN\Entity\Empresas\Empresa") * @ORM\JoinTable( * name=...
asked by 16.03.2015 / 03:00
2
answers

Select specific columns from a repository in Doctrine 2

First, we know that depending on the number of columns in a query, you can increase response time. In Doctrine I call the following repository, which has a relationship and which brings all the columns of both entities. public function inde...
asked by 31.12.2014 / 18:25
1
answer

error with ORM Mapping no doctrine 2

I am mapping the database with doctrine and am having a problem. When I use Annotations the following way works perfectly: /** * @Entity * @Table(name="customer",uniqueConstraints={@UniqueConstraint(name="email", columns={"email"})}) */ cla...
asked by 04.12.2014 / 16:15
1
answer

Doctrine 2 - Does not recognize class mapped with $ entityManager-getRepository ()

I'm going to be a little ... In my bootstrap.php file I'm trying to get the repository of a given entity and gives Fatal Error , stating that the Class does not exist, but it exists. Here is the error message: Fatal error: Uncaugh...
asked by 02.07.2014 / 14:39
1
answer

Doctrine prepare-execute

Hello, I'm doing this query with Doctrine $retorno = $em->getConnection()->prepare(" SELECT t.id_programa_fidelidade_diario, t.loja, t.nota, t.data, t.ecf, t.operador, o.nom...
asked by 12.03.2018 / 21:50
1
answer

Criteria query with expression contains in the field of a ManyToOne entity

Considering the two entities below: /** * @ORM\Table(name="cliente") * @ORM\Entity */ class Cliente { /** * @ORM\Column(name="id_cliente", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ priva...
asked by 27.08.2015 / 13:28
1
answer

Symfony2 - Refresh field of one entity when executing action on Controller of another entity

I need to update the budget field of my Client entity when entering new data into the Budget table. Both have relation oneToMany and manyToOne , respectively. I received suggestions to use the OO concept to do this operation, so somethi...
asked by 08.09.2015 / 05:03
1
answer

How to use OnUpdate = Cascade in Doctrine 2

/** * @ORM\ManyToOne(targetEntity="JN\Entity\Planos\Plano") * @ORM\JoinColumn(name="plano_id", referencedColumnName="id", nullable=true, onDelete="SET NULL", onUpdate="CASCADE") **/ private $plano; Thank you     
asked by 22.02.2015 / 23:10
1
answer

Symfony2 / 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', 'u') ->where('u.id = t.user');...
asked by 16.06.2014 / 19:40
1
answer

Blameable behavior does not work on Symfony2

I'm implementing the Blameable behavior in Symfony2 using Gedmo\Mapping\Annotation . I was able to successfully implement Timestampable , but I can not implement Blameable . The problem in question is that I can not get...
asked by 17.03.2014 / 11:10