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

Extracting a list of products bu category using doctrine

I want to extract a list of products by given category, I dont know how to do that! I have found findAll which return all products in database should I use dql? somthing like: my controller public function ProductByCategory(Request $request,…
Julie
  • 563
  • 6
  • 10
  • 23
3
votes
1 answer

How to improve doctrine performance (plain sql is 4x faster)?

The problem is next - I want to execute simple query (e.g. 10 rows from one table) In Doctrine this operation takes 0.013752s Here is DQL: $q = Doctrine_Query::create() ->update('TABLE') ->set('FIELD', 1) ->where('ID = ?', $id); $rows =…
John W.
  • 233
  • 1
  • 5
  • 9
3
votes
1 answer

How to configure Doctrine Entity Annotation autoloading in User-defined symfony Bundle?

When I try to validate my symfony schema, I get the error: [Doctrine\Common\Annotations\AnnotationException] [Semantical Error] The annotation "@Doctrine\Orm\Mapping\Entity" in class C hill\EmailUser\Entity\EmailUser…
arthur.00
  • 175
  • 1
  • 6
3
votes
0 answers

Database schema updated successfully! "6" queries were executed but not really

I've got big troubles with doctrine cache. Context: schema updated (an entity with new table name) cache deleted (definitively removed by hand) cache cleared (with a doctrine command) rm -fr var/cache/prod/ rm -fr var/cache/dev/ rm -fr…
sensorario
  • 20,262
  • 30
  • 97
  • 159
3
votes
1 answer

Argument 3 passed to Doctrine\ORM\Event\PreUpdateEventArgs::__construct() must be of the type array, null given, called in UnitOfWork.php on line 1060

Catchable Fatal Error: Argument 3 passed to Doctrine\ORM\Event\PreUpdateEventArgs::__construct() must be of the type array, null given, called in /srv/mysite/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php on line 1060 and defined In…
Ricky ponting
  • 4,537
  • 4
  • 13
  • 26
3
votes
2 answers

Symfony3 doctrine Many-to-Many column not found on select

I'm begginer with Symfony and Doctrine and I have a problem with a many-to-many relationship. I have the next two entities, relationated with many-to-many. AppBundle/Entity/User.php /** * @ORM\ManyToMany(targetEntity="Team", mappedBy="user",…
RL83
  • 39
  • 8
3
votes
2 answers

Can't change model builder options

I'm trying to get symfony to use a custom class called jsDoctrineRecord instead of sfDoctrineRecord for its models. Here's the code for the overriding class:
Jason Swett
  • 43,526
  • 67
  • 220
  • 351
3
votes
2 answers

Extending sfDoctrineRecord in symfony

I've added some functionality to some of my instance classes in my symfony project that I want ALL of my instance classes to have. If I didn't have any qualms about editing the core symfony installation, I would just add my methods directly to the…
Jason Swett
  • 43,526
  • 67
  • 220
  • 351
3
votes
2 answers

Whats is the use of annotation group in doctrine

I am new to doctrine, In my symfony project all the entity annotation linked with groups but I am not getting what is the use of Groups. /** * @ORM\Column(type="string", length=64) * @Groups({"public","details"}) */ I have newly…
Govinda raj
  • 613
  • 3
  • 16
  • 31
3
votes
1 answer

Custom Collections in Doctrine 1.2

I'm using Doctrine 1.2. I'd like to execute a Doctrine_Query that, instead of returning a Doctrine_Collection will return a class of my choosing. That is, something like $o = Doctrine_Query::create() ->from('Foo') ->execute(); $o; //instance of…
Alana Storm
  • 164,128
  • 91
  • 395
  • 599
3
votes
1 answer

Manual escaping in Doctrine

When you're writing native SQL statements with Doctrine, how are you supposed to escape input? In my experience, mysql_real_escape_string doesn't work.
Jason Swett
  • 43,526
  • 67
  • 220
  • 351
3
votes
1 answer

Symfony / PHP - Best way to store single value

Assuming that I have an application running on Symfony 3.2 / Doctrine. Question : What is the best way to store a single value that gonna change over some actions. First thoughts : Im thinking that creating an Entity that is going to have a single…
Youssef
  • 401
  • 1
  • 5
  • 23
3
votes
1 answer

How to make Doctrine PostgreSQL Foreign Key constrain DEFERRABLE

Using Doctrine2 and PostgreSQL I need to create foreign key constrains DEFERRABLE and INITIALLY DEFERRED Found options "deferrable" and "deferred" In Doctrine/DBAL/Platforms/PostgreSqlPlatform.php, but have no idea where to use it inside Entity…
Diabl0
  • 146
  • 7
3
votes
1 answer

Compiling doctrine as a extension to php

Heard that doctrine makes php code slow which is understandable. Found people suggesting to use opcode caching to improve it a bit. Cant we take it a bit further and make it a part of php? Is doctrine common…
user332045
  • 31
  • 2
3
votes
1 answer

Re-run doctrine migrations

I can I make a doctrine migration re-run in the server without having to access it through SSH to erase the migration on the DB? If I change the name of the migration file will it work?
Danubio
  • 123
  • 11
1 2 3
99
100