Questions tagged [doctrine]

The Doctrine Project is a collection of open source libraries and tools for dealing with database abstraction and Object-Relational Mapping written in PHP.

The Doctrine Project is a collection of open source libraries and tools for dealing with database abstraction and Object-Relational Mapping written in PHP.


Doctrine 2

When we say Doctrine 2 it usually refers to Doctrine ORM Project. The ORM sits on top of the database abstraction layer (called DBAL). It also uses Doctrine Common (which provides extensions to core PHP functionality).

Side projects

Then you have side projects dedicated to some DBMS which provide transparent persistence for PHP objects:

Documentation

Useful links


Doctrine 1

The first version doesn't have a separate project for the relational mapper and the database abstraction layer. It requires PHP 5.2.3+ and the latest version is 1.2.5.

11930 questions
3
votes
1 answer

Symfony 3 uniqueEntity validation with many to many relationship

I struggle finding the solution for this problem: I have 2 classes contact and phones with a manytomany relationship. The phones table has 2 fields : countryCode and number. I want to check that 2 contacts don't have the same telephone number, so…
Jerry
  • 31
  • 2
3
votes
2 answers

Circular reference detected for service "doctrine.dbal.default_connection", path: "doctrine.dbal.default_connection"

An error occurred when I tried to put the service @doctrine.orm.entity_manager as an argument for my listener UserDeletionListener. My service: se.doctrine_listener.user_deletion: class: SE\CoreBundle\DoctrineListener\UserDeletionListener …
Lenny4
  • 1,215
  • 1
  • 14
  • 33
3
votes
1 answer

Doctrine related entities return all fields values NULL

I am using Symfony 3.1.10 on a server with PHP 5.6.31 (with Zend OPcache 7.0.6-dev), Apache and MySQL (Ver 14.14 Distrib 5.6.37). I have an Entity called Document with a related Entity called Worker The relationship have always worked untill…
Fra Ore
  • 59
  • 2
  • 6
3
votes
1 answer

Use server-sent events in combination with doctrine events to detect changes?

In my app I'm using server-sent events and have the following situation (pseudo code): $response = new StreamedResponse(); $response->setCallback(function () { while(true) { // 1. $data = fetchData(); // 2. echo "data: $data"; …
arm1n
  • 151
  • 1
  • 7
3
votes
1 answer

Skip exceptions doctrine migrations

I know that It seems a strange behaviour avoid exceptions in doctrine but I need to do that because I am working in a old project and someone in the past executed some migrations and then he decided remove it so right now is complicated to replicate…
Castor Duran
  • 309
  • 1
  • 16
3
votes
2 answers

Doctrine postPersist Event deprecated getEntity function

In Symfony after creating a Doctrine postPersist EventListener, my IDE pointed to the $args->getEntity() line; As being deprecated, I do not know how I can remedy this because it is the same code as in the Symfony docs for version 2.8 Screenshot…
helmis.m
  • 234
  • 1
  • 18
3
votes
1 answer

encoding password with symfony3: Catchable Fatal Error: Argument 3 passed to

I'm trying to encode the password in symfony3 but i'm facing some problems. this is the error i got. Catchable Fatal Error: Argument 3 passed to GMAOBundle\Security\LoginFormAuthentificator::__construct() must be an instance of…
Med Amine
  • 57
  • 5
3
votes
1 answer

Doctrine querybuilder with joins - hydrate array

I've noticed a behaviour I've not really encountered with doctrine under symfony 3.3 of late. If I use a querybuilder with some joins, in the result set that I get back, I end up with each table on a new row in the resultant array - For example, if…
Chris Jolley
  • 33
  • 1
  • 4
3
votes
2 answers

Doctrine and SQL Injection

Does Doctrine automatically prevent SQL injection? Is the following code secure? $user = new Model_User(); $user->name = $_POST['username']; $user->save();
peter
  • 71
  • 1
  • 5
3
votes
1 answer

Search for Entity that has multiple tags in doctrine

I have a many to many relation between Document and Tag. So a Document can have several Tags's, and one Tag can be assigned to different Document's. This is Tag AppBundle\Entity\Tag: type: entity table: tags repositoryClass:…
Asara
  • 2,791
  • 3
  • 26
  • 55
3
votes
1 answer

Doctrine get repository of all models that extends given abstract class

I have two models: NoteItem and TaskItem. Both extends from AbstractStreamItem: abstract class AbstractCommentsItem { … } class CommentItem extends AbstractCommentsItem { … } class TaskItem extends AbstractCommentsItem { … } Now I…
julew
  • 216
  • 3
  • 14
3
votes
3 answers

Symfony : should logic about formatting a parameter be in repository or controller?

What is the best practice according the Symfony way ? Option 1 : class MyController extends Controller { public function myAction(...) { // .. $example =…
lepix
  • 4,992
  • 6
  • 40
  • 53
3
votes
1 answer

peer_method in symfony's admin generator

I have a symfony module for my GenericImport class. Rather than the default method symfony uses for the list page, I want to use GenericImportTable::getQueue(). I thought the following would work but it didn't: config: actions: ~ fields: …
Jason Swett
  • 43,526
  • 67
  • 220
  • 351
3
votes
1 answer

Could not load Type "Doctrine\DBAL\Types\TextType"

I got a Post Entity for all values, with get and set methods e.g. /** * @var string * * @ORM\Column(name="autor", type="string", length=32) */ private $autor; In my controller I call the formBuilder with this class …
TNation
  • 89
  • 9
3
votes
3 answers

Doctrine Sluggable - Column 'slug' cannot be null

I am using Doctrine, with DoctrineExtensions via StofDoctrineExtensionsBundle to generate slugs automatically using "Doctrine Extensions Sluggable" behavior. The listener seems to be registred properly. Entity field is also marked as sluggable.…
1 2 3
99
100