[DDC-1961] BC Break: Explicit parameter type definitions are discarded when using AbstractQuery::setParameter Created: 31/Jul/12  Updated: 31/Jul/12  Resolved: 31/Jul/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: 2.3
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Blocker
Reporter: Michael Moravec Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

In 2.2.x it was possible to explicitly specify a type of a parameter in query. In code below, I used a Type::DATE to explicitly say that it should be converted to date type rather than datetime. In 2.3-RC1, it is completely ignored.

// $query instanceof AbstractQuery
$query->setParameter('day', $date, Type::DATE)

Pull request: https://github.com/doctrine/doctrine2/pull/416



 Comments   
Comment by Benjamin Eberlei [ 31/Jul/12 ]

Fixed





[DDC-1784] Error on generate entities: 'Attribute "allocationSize" of @ORM\SequenceGenerator' Created: 18/Apr/12  Updated: 27/May/12  Resolved: 20/Apr/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: Tools
Affects Version/s: 2.2.2
Fix Version/s: 2.2.3, 2.3
Security Level: All

Type: Bug Priority: Blocker
Reporter: Augusto Ximenes de Souza Assignee: Fabio B. Silva
Resolution: Fixed Votes: 0
Labels: None


 Description   

When I generated my entities on version 2.2.2 through "orm:convert-mapping", the sequence has a value ' allocationSize="1", initialValue="1" ' with quotes.

So I received an error:

Attribute "allocationSize" of @ORM\SequenceGenerator declared on property entities\Test::$id expects a integer, but got string.

To fix, I removed the quotes. is It a bug?

Part of entity generated:

/**

  • @var integer $id
    *
  • @ORM\Column(name="id", type="integer", precision=0, scale=0, nullable=false, unique=false)
  • @ORM\Id
  • @ORM\GeneratedValue(strategy="SEQUENCE")
  • @ORM\SequenceGenerator(sequenceName="test_id_seq", allocationSize="1", initialValue="1") /* SEE QUOTES ON allocationSize="1", initialValue="1" */
    */
    private $id;


 Comments   
Comment by Augusto Ximenes de Souza [ 18/Apr/12 ]

I think the problem is on the line 1037 to 1042 of Class Doctrine \ ORM \ Tools \ EntityGenerator:

if (isset($metadata->sequenceGeneratorDefinition['allocationSize']))

{ $sequenceGenerator[] = 'allocationSize="' . $metadata->sequenceGeneratorDefinition['allocationSize'] . '"'; }

if (isset($metadata->sequenceGeneratorDefinition['initialValue']))

{ $sequenceGenerator[] = 'initialValue="' . $metadata->sequenceGeneratorDefinition['initialValue'] . '"'; }

Replace to:

if (isset($metadata->sequenceGeneratorDefinition['allocationSize']))

{ $sequenceGenerator[] = 'allocationSize=' . $metadata->sequenceGeneratorDefinition['allocationSize']; }

if (isset($metadata->sequenceGeneratorDefinition['initialValue']))

{ $sequenceGenerator[] = 'initialValue=' . $metadata->sequenceGeneratorDefinition['initialValue']; }
Comment by Fabio B. Silva [ 20/Apr/12 ]

Fixed by : https://github.com/doctrine/doctrine2/commit/d5d47222c1dc5ea97ebd8f4c68834fbe4abeb238

Comment by Benjamin Eberlei [ 27/May/12 ]

Merged into 2.2





[DDC-1657] The Doctrine cli tool does not handle schema correctly. Created: 19/Feb/12  Updated: 08/Jul/12  Resolved: 08/Jul/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: Tools
Affects Version/s: 2.2
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Critical
Reporter: Presteus Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None
Environment:

Linux Mint Debian Edition, PHP 5.3.10, PostgreSQL 9.1



 Description   

At first time, sorry for my english and I will be short and brief, the problem is clearly explained in the title and the test is very simple.

The entity

/**
 * Short description.
 *
 * @Entity(repositoryClass="Stonewood\Model\Entity\Repository\Screen")
 * @Table(name="stonewood.screen")
 */
class Screen extends Entity
{

    /**
     * Identifier
     * @var integer
     *
     * @Id
     * @GeneratedValue(strategy="IDENTITY")
     * @Column(name="pk", type="integer", nullable=false)
     */
    private $pk;

    /**
     * Title
     * @var string
     *
     * @Column(name="title", type="string", length=255, nullable=false)
     */
    private $title;

    /**
     * Path
     * @var string
     *
     * @Column(name="path", type="string", length=255, nullable=false)
     */
    private $path;

    /**
     * Register date
     * @var Date
     *
     * @Column(name="ddate", type="date", nullable=false)
     */
    private $ddate;

    /**
     * Avatar
     * @var Stonewood\Model\Entity\Avatar
     *
     * @ManyToOne(targetEntity="Stonewood\Model\Entity\Avatar")
     * @JoinColumn(name="pk_avatar", referencedColumnName="pk", nullable=true, onDelete="CASCADE")
     */
    private $avatar;

    /**
     *
     */
    public function __construct($pk = null, $title = null, $path = null, $ddate = null, $avatar = null) {
        $this->setPk($pk);
        $this->setTitle($title);
        $this->setPath($path);
        $this->setDdate($ddate);
        $this->setAvatar($avatar);
    }

    [...]

}

Before the first deployment

./doctrine orm:schema-tool:update --dump-sql
CREATE TABLE stonewood.screen (pk SERIAL NOT NULL, pk_avatar INT DEFAULT NULL, title VARCHAR(255) NOT NULL, path VARCHAR(255) NOT NULL, ddate DATE NOT NULL, PRIMARY KEY(pk));
CREATE INDEX IDX_D91A7FB3E9032144 ON stonewood.screen (pk_avatar);

During the first deployement

 
./doctrine orm:schema-tool:update --force
Updating database schema...
Database schema updated successfully! "100" queries were executed

I test the application and all work correctly

After this test

 
./doctrine orm:schema-tool:update --dump-sql
ALTER TABLE screen ADD pk SERIAL NOT NULL;
ALTER TABLE screen ADD pk_avatar INT DEFAULT NULL;
ALTER TABLE screen ADD title VARCHAR(255) NOT NULL;
ALTER TABLE screen ADD path VARCHAR(255) NOT NULL;
ALTER TABLE screen ADD ddate DATE NOT NULL;
ALTER TABLE screen ADD CONSTRAINT FK_D91A7FB3E9032144 FOREIGN KEY (pk_avatar) REFERENCES stonewood.avatar (pk) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE;
CREATE INDEX IDX_D91A7FB3E9032144 ON screen (pk_avatar);
ALTER TABLE screen ADD PRIMARY KEY (pk);

The result is false. I should see Nothing to update - your database is already in sync with the current entity metadata.
In addition, the schema name does not appear, except for foreign key, what must be causing the problem.



 Comments   
Comment by Benjamin Eberlei [ 27/May/12 ]

This issue was partially fixed in DBAL already, however it seems there is still a problem with sequence detection.

Comment by Benjamin Eberlei [ 08/Jul/12 ]

Fixed the sequence problem in 2.3, the other schema problems where indeed fixed in 2.2.1 already.





[DDC-1598] ProxyFactory makes assumptions on identifier getter code Created: 13/Jan/12  Updated: 16/Jan/12  Resolved: 16/Jan/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.0.6, 2.0.7, 2.1, 2.1.1, 2.1.2, 2.1.3, 2.1.4, 2.1.5, 2.2-BETA1, 2.2-BETA2, Git Master
Fix Version/s: 2.2, 2.3, 2.x
Security Level: All

Type: Bug Priority: Critical
Reporter: Marco Pivetta Assignee: Benjamin Eberlei
Resolution: Invalid Votes: 0
Labels: None


 Description   

As of
https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Proxy/ProxyFactory.php#L214
and
https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Proxy/ProxyFactory.php#L237
the current ProxyFactory isn't actually checking if the identifier getter has logic in it.
Current checks aren't enough/valid.

In my opinion the check should be matching following:

(public|protected)\s+function\s+getFieldname\s*(\s*)\s+

{\s*\$this\s*->Fieldname\s*;\s*}

Not really experienced with regex, but currently cannot come up with a more secure check.



 Comments   
Comment by Benjamin Eberlei [ 15/Jan/12 ]

Can you explain why you think this is necessary?

You are right an id method with logic could exist in 4 lines of code, but for what purpose?

Comment by Marco Pivetta [ 15/Jan/12 ]

First of all it is a question of concept. Doctrine shouldn't assume anything about entities outside of their fields. It already introduces a level of complication when we explain how to clone/serialize objects, which was very confusing.

Asking for the purpose of an identifier field getter method is in my opinion again an attempt of making assumptions over user's code...

What if the user wrote something like:

public function getIdentifierField1()
{
return $this->identifierField1? $this->_myInitializationStuff() : null;
}

private function _myInitializationStuff()
{
//open files, check stuff, make things difficult for the D2 team
}

For instance, opening file handlers, sockets, whatever... This is a case that would break the entity because of optimization introduced by the ProxyFactory. (not to mention when getIdentifierField1 does some conversion, like return $this->identifierField1 + self::OFFSET_REQUIRED_BY_WEBSERVICE;

I'm not arguing about the validity of this optimization, but that the checks are too lazy.

I've read something about moving the ProxyFactory to common and using code scanner tools, and the check should be about applying the optimization only when the form is

return $this->identifierField1;

That's why I put the example of the regex. That would probably not be as safe as using some reflection-based tool, but surely more than just checking if the code is <= 4 lines...

Comment by Marco Pivetta [ 15/Jan/12 ]

Also don't know what stuff like EAccelerator (known in this Jira as of it's fantastic idea about stripping comments) would make the check of the 4 lines like.

Comment by Benjamin Eberlei [ 16/Jan/12 ]

This argument is void i just seen

A method:

public function getIdentifierField1()
{
   return $this->identifierField1? $this->_myInitializationStuff() : null;
} 

Will only used when the id is not set anyways.

In any other case Ids are Immutable and changing them in your code would break a lot more than just this smart proxy method generation.

Comment by Marco Pivetta [ 16/Jan/12 ]

Nope, this code actually works only if the ID is set
I'm not talking about changing IDs, it's just that getters and setters don't always reflect the class attributes...

Comment by Marco Pivetta [ 16/Jan/12 ]

As of IRC there's 3 ways (for now) to get this solved:

  • Some code scanner/stronger checks (difficult/problems with private methods/slow)
  • Regex (as of description)
  • Adding configuration (per-entity or per-method. Probably too messy)
  • Documenting it as "magic" of proxies and let the users be aware of it




[DDC-1831] Problem while implement a relation many to many with columns names starting with caps Created: 21/May/12  Updated: 06/Jul/12  Resolved: 06/Jul/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: None
Fix Version/s: 2.3

Type: Bug Priority: Critical
Reporter: Pablo Minetti Assignee: Fabio B. Silva
Resolution: Fixed Votes: 0
Labels: None

Attachments: Text File defect_patch.txt    

 Description   

Hi, In my team we are implementing a solution that involves make a relation many to many.

The problem is that the columns names of the middle table start with caps.

we make correction to ORM to solve this problem. I attach to you the files modify.



 Comments   
Comment by Fabio B. Silva [ 05/Jun/12 ]

Hi Pablo,

I'm working on a quote patch right now.
I think that will fix a lot of quote issues.

Could you attach a test for this case please ?

Comment by Benjamin Eberlei [ 05/Jul/12 ]

Fabio, any stats on this one? Is it fixed through your change?

Comment by Fabio B. Silva [ 05/Jul/12 ]

There is no answers from Pablo,

I think this is fixed by quote strategy, also DDC-1850
but without entities or tests is hard to know if are really fixed.

if we don't get any feedback from Pablo, I think both could be closed.

Comment by Benjamin Eberlei [ 06/Jul/12 ]

No feeback given and a fix was pushed to master. Please reopen if problems persist with master + custom quoting strategy.





[DDC-1802] DQL parser issue when using FunctionsReturningStrings(...) NOT LIKE Created: 30/Apr/12  Updated: 04/May/12  Resolved: 04/May/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: DQL
Affects Version/s: 2.1.3, 2.1.4, 2.1.5, 2.1.6, 2.2-BETA1, 2.2-BETA2, 2.2.0-RC1, 2.2, 2.2.1, 2.2.2
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Critical
Reporter: Martin Hasoň Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

If you create a query like the following, you will get an exception:

$em->createQuery( "SELECT e FROM MyEntity e WHERE CONCAT(e.name, e.name2) NOT LIKE '%abc%'" );

The variable $token['type'] is Lexer::T_NOT - https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Query/Parser.php#L2238



 Comments   
Comment by Alexander [ 04/May/12 ]

https://github.com/doctrine/doctrine2/pull/345 got merged





[DDC-807] Adding columnDefinition for @DiscriminatorColumn Created: 15/Sep/10  Updated: 14/Feb/12  Resolved: 14/Feb/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: 2.0-BETA4
Fix Version/s: 2.3
Security Level: All

Type: New Feature Priority: Major
Reporter: Lars Strojny Assignee: Fabio B. Silva
Resolution: Fixed Votes: 0
Labels: None


 Description   

Current @DiscriminatorColumn does not allow to use a specific column definition. However, in the MySQL world it is quite common to use the ENUM or TINYINT datatype for efficient discriminator columns. It would be great if something like this would be possible:

@DiscriminatorColumn(name="member_type",type="string",columnDefinition="ENUM('ANONYMOUS','FREE','PREMIUM')")


 Comments   
Comment by Benjamin Eberlei [ 15/Sep/10 ]

How is ENUM efficient? Its a very bad datatype in my opinion with its sorting strangeness and alter table overhead

Comment by Lars Strojny [ 16/Sep/10 ]

The alternative with MySQL is TINYINT, which has the drawback of not being self documenting but also works. But this won't be possible with discriminator columns too.

Comment by Marc Hodgins [ 17/Sep/10 ]

Duplicate of DDC-553

Comment by Guilherme Blanco [ 14/Feb/12 ]

Fixed

https://github.com/doctrine/doctrine2/commit/e6b99c2059d33db744689001b477e8921c35ebfb





[DDC-1185] Make default column naming strategy configurable Created: 30/May/11  Updated: 29/Dec/11  Resolved: 29/Dec/11

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Improvement Priority: Major
Reporter: Johannes Schmitt Assignee: Fabio B. Silva
Resolution: Fixed Votes: 0
Labels: None


 Description   

Right now, the property name is simply taken as column name. It would be nice if this default naming strategy were made configurable, so that you could plugin for example a camel-cased underscored naming strategy.



 Comments   
Comment by Fabio B. Silva [ 29/Dec/11 ]

FIxed in https://github.com/doctrine/doctrine2/commit/abb258c951dd416fc5325ef548d15c7acd35703e





[DDC-964] Implement @AssociationOverride and @FieldOverride for MappedSuperclasses Created: 31/Dec/10  Updated: 02/May/12  Resolved: 02/May/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: Mapping Drivers
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: New Feature Priority: Major
Reporter: Benjamin Eberlei Assignee: Fabio B. Silva
Resolution: Fixed Votes: 2
Labels: None


 Description   

We should allow to override certain attributes of associations and fields that are defined in a mapped superclass:

1. Fields should allow the Column Name to be different.
2. Associations should allow join columns and join table.



 Comments   
Comment by Benjamin Eberlei [ 14/Dec/11 ]

This issue is referenced in Github Pull-Request GH-218
https://github.com/doctrine/doctrine2/pull/218

Comment by Fabio B. Silva [ 02/May/12 ]

Fixed by : https://github.com/doctrine/doctrine2/commit/0a09a28ec9301b371da54babb076df84a0d2033f





[DDC-954] Look into deferring foreign key checks until flush finished Created: 28/Dec/10  Updated: 23/May/12  Resolved: 23/May/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Improvement Priority: Major
Reporter: Benjamin Eberlei Assignee: Guilherme Blanco
Resolution: Fixed Votes: 1
Labels: None

Issue Links:
Dependency
is required for DDC-959 Problem deleting when the foreign ke... Resolved
Sub-Tasks:
Key
Summary
Type
Status
Assignee
DDC-369 Bulk-Delete on Self-Referencing CTI f... Sub-task Resolved Guilherme Blanco  
DDC-890 Association mapping 'One-To-Many, Sel... Sub-task Resolved Guilherme Blanco  

 Description   

There are several timing issues that will be complicated to fix which relate to foreign key checks.

If we could optionally allow people to defer the foreign key checks until flush has fully completed we could simply solve them all, maybe even across all vendors?



 Comments   
Comment by Benjamin Eberlei [ 29/Dec/10 ]

Postgresql: http://stackoverflow.com/questions/139884/how-do-i-disable-referential-integrity-in-postgres-8-2
Mysql: http://cristian-radulescu.ro/article/disable-foreign-key-checks-in-mysql.html
Oracle: http://infolab.stanford.edu/~ullman/fcdb/oracle/or-triggers.html#deferring%20constraint%20checking
Mssql: No clue?!
Sqlite: no foreign key support (yet)
DB2: not researched (IBM should provide better DB2 support for PHP first).

Comment by Guilherme Blanco [ 23/May/12 ]

As per https://github.com/doctrine/doctrine2/commit/3e601c3a53226ce981fe82db164f297a8d605ae7 all tests related to this issue are closed.
Marking this ticket as fixed on 2.3.





[DDC-889] Not a mapped superclass or id not found exceptions should mention parent classes Created: 23/Dec/10  Updated: 30/Mar/12  Resolved: 30/Mar/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Improvement Priority: Major
Reporter: Benjamin Eberlei Assignee: Fabio B. Silva
Resolution: Fixed Votes: 0
Labels: None


 Description   

When either the "not an entity or mapped superclass" or the "no id/primary key found" exceptions are thrown the Mapped Parent classes of $cm->parentClasses should be mentioned for debugging purposes.



 Comments   
Comment by Benjamin Eberlei [ 30/Mar/12 ]

Merged





Look into deferring foreign key checks until flush finished (DDC-954)

[DDC-890] Association mapping 'One-To-Many, Self-referencing' with cascade and removes fk onDelete=restrict Created: 23/Nov/10  Updated: 23/May/12  Resolved: 23/May/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: Git Master
Fix Version/s: 2.3
Security Level: All

Type: Sub-task Priority: Major
Reporter: André Ribeiro de Miranda Assignee: Guilherme Blanco
Resolution: Fixed Votes: 1
Labels: None

Attachments: Text File patch.diff    

 Description   

By using the association mapping 'One-To-Many, Self-referencing' removes the cascade.

How to follow the example below, and removed the first parent entity after the children entities.

And if you use foreign key onDelete=restrict the referential integrity error

A possible solution in the patch attached below

Category.php
<?php
/** @Table(name="category") */
class Category
{
    /**
     * @Id
     * @Column(name="id")
     */
    public $id;

    /**
     * @OneToMany(targetEntity="Category", mappedBy="parent", cascade={"remove"})
     */
    public $children;

    /**
     * @ManyToOne(targetEntity="Category", inversedBy="children")
     * @JoinColumn(name="parent_id", referencedColumnName="id")
     */
    public $parent;

    public function __construct() {
        $this->children = new \Doctrine\Common\Collections\ArrayCollection();
    }
}
?>
CREATE TABLE `category` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `parent_id` int(10) unsigned DEFAULT NULL,
  `name` varchar(50) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_id_parent_id` (`parent_id`),
  CONSTRAINT `fk_id_parent_id` FOREIGN KEY (`parent_id`) REFERENCES `category` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC


 Comments   
Comment by Guilherme Blanco [ 23/May/12 ]

Seems to be fixed already in master.
Closing the ticket.





[DDC-1473] GH-181: make merge copy non persisted properties too Created: 06/Nov/11  Updated: 06/Aug/12  Resolved: 04/May/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

Pull-Request was automatically synchronized

The behavior of merging should be to return a managed object with exactly the same values than the detached one.

The problem was that it only copies persistable properties.



 Comments   
Comment by Benjamin Eberlei [ 06/Aug/12 ]

A related Github Pull-Request [GH-181] was opened
https://github.com/doctrine/dbal/pull/181

Comment by Benjamin Eberlei [ 06/Aug/12 ]

A related Github Pull-Request [GH-181] was closed
https://github.com/doctrine/dbal/pull/181





[DDC-1426] Github-PR-115 by mpdeimos: findByXXX does not accept orderBy/limit/offset Created: 17/Oct/11  Updated: 11/Mar/12  Resolved: 11/Mar/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Improvement Priority: Major
Reporter: Guilherme Blanco Assignee: Alexander
Resolution: Fixed Votes: 0
Labels: None


 Description   

Our modification to pass findByXXX functions orderBy/limit/offset params for entity repositories like one is used from normal findBy function.

We're using an if cascade in favor of the call_user_function_array since the latter is considered as slow.

PS: If i need to target this pull request to your master, I'll resubmit - it's just that we're building against a stable codebase.

Reference link: https://github.com/doctrine/doctrine2/pull/115



 Comments   
Comment by Alexander [ 11/Mar/12 ]

Added in master. See here: https://github.com/doctrine/doctrine2/pull/115.





[DDC-1412] DriverChain defaultDriver Created: 11/Oct/11  Updated: 29/Jan/12  Resolved: 28/Jan/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: Mapping Drivers
Affects Version/s: Git Master
Fix Version/s: 2.3
Security Level: All

Type: New Feature Priority: Major
Reporter: Thomas Tourlourat - Armetiz Assignee: Fabio B. Silva
Resolution: Fixed Votes: 0
Labels: None

Attachments: Text File driverchain.patch    

 Description   

The \Doctrine\ORM\Mapping\Driver\DriverChain is a good thing, but a default driver should be a another great thing.

Actually, to use DoctrineExtension Translatable I have to use the DriveChain to add a specific driver for Gedmo\Translatable.
The problem is, that I have to define the same EntityDriver on all my entity in this driver.

$driverChain->addDriver ($entityDriver, 'EntityA');
...
$driverChain->addDriver ($entityDriver, 'EntityB');
$driverChain->addDriver ($translatableDriver, 'Gedmo\Translatable');

It would be really friendly to do
$driverChain->setDefaultDriver ($entityDriver);
$driverChain->addDriver ($translatableDriver, 'Gedmo\Translatable');

I have attach a fix (SVN) for the DriveChain class.



 Comments   
Comment by Fabio B. Silva [ 29/Jan/12 ]

Fixed in : https://github.com/doctrine/doctrine2/commit/16b22f0f3138ad607ccecd9397d0ec267d6cc478





[DDC-1379] Entity Generator Bug with extended classes Created: 16/Sep/11  Updated: 09/Jan/12  Resolved: 09/Jan/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Mark Badolato Assignee: Benjamin Eberlei
Resolution: Duplicate Votes: 0
Labels: None


 Description   

I'm presently using Doctrine 2 in conjunction with Symfony 2 and have come across a bug with the Entity Generator when I'm extending an abstract class. Here's a minor example to demonstrate (please note, any annotations problems or typos are a result of my typing in this ticket. This isn't an actual example, but does accurately show how to reproduce the issue)

Foo.php
abstract class Foo
{
    /**
     * @Column(name="first_name")
     */
    protected $firstName;

     /**
     * @Column(name="last_name")
     */
    protected $lastName;
    /**
     * @ORM\Column(name="is_active", type="boolean")
     */
    protected $isActive;
}
Bar.php
/**
 * @Entity
 */
class Bar extends Foo
{
    /**
     * @Id
     * @Column(type="integer")
     * @GeneratedValue(strategy="AUTO")
     */
    protected $id;

    /**
     * @Column(name="created_at", type="datetime")
     */
    protected $createdAt;
}

Using a setup similar to the above, where Bar extends Foo, there is an issue with the Generator.

1) The generator is redeclaring Foo's properties, as private variables, in Bar

So, opening Bar after running the generator, shows the getters and setters, but shows:
private $firstName;
private $lastName;
private $isActive;

This causes issues because the properties are being recreated as local versions, and their scope is set to private, conflicted with the more open protected version in the abstract class. To me, they shouldn't be placed in Bar because they're declared as protected in Foo and thus Bar has access to them. Also, when they are placed in Bar, the file formatting is messed up around them, suggesting that they were mis-placed in the file.

2) This may or may not be a bug (it may be intended behavior), but... I would think that when running the generator, the getters and setters for the protected properties declared in Foo would be placed in Foo, and not placed in the class(es) that extend Foo (in this case, Bar). If I also have a class Baz that extends Foo, then Bar and Baz will now have copies of the same getFirstName(), getLastName(), and getIsActive() methods, which is unneeded. They can be placed in the parent class, and overridden in the subclasses if more/different functionality/behavior is needed by the subclass.

Hopefully this is a clear example. Please feel free to hit me up for more info!
--mark



 Comments   
Comment by Christoph Schaefer [ 30/Oct/11 ]

I can confirm this behavior.

Before generation:

Foo
/**
 * @ORM\Entity
 * @ORM\HasLifecycleCallbacks
 *
 * @ORM\InheritanceType("JOINED")
 * @ORM\DiscriminatorColumn(name="discr", type="string")
 * @ORM\DiscriminatorMap({"foo_bar" = "FooBar"})
 */
class Foo
{

    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

    /**
     * creation date
     *
     * @ORM\Column(name="created_at",type="datetime")
     */
    protected $createdAt;

    /**
     * getCreatedAt
     *
     * @return \DateTime
     */
    public function getCreatedAt()
    {
        return $this->createdAt;
    }

    /**
     * Set the creation date
     *
     * @return null
     */
    public function setCreatedAt(\DateTime $createdAt)
    {
        $this->createdAt = $createdAt;
    }

    /**
     * @ORM\PrePersist
     */
    public function prePersist()
    {
        $this->createdAt = new \DateTime();
    }
}
FooBar
/**
 * @ORM\Entity
 */
class FooBar extends Foo {

    /**
     *
     * @ORM\Column(type="string", length=255)
     */
    protected $title;
}

after generation of FooBar:

FooBar
/**
 * @ORM\Entity
 */
class FooBar extends Foo {

    /**
     *
     * @ORM\Column(type="string", length=255)
     */
    protected $title;

    /**
     * @var integer $id
     */
    private $id;

    /**
     * @var datetime $createdAt
     */
    private $createdAt;

    /**
     * Set title
     *
     * @param string $title
     */
    public function setTitle($title)
    {
        $this->title = $title;
    }

    /**
     * Get title
     *
     * @return string 
     */
    public function getTitle()
    {
        return $this->title;
    }

    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set createdAt
     *
     * @param datetime $createdAt
     */
    public function setCreatedAt($createdAt)
    {
        $this->createdAt = $createdAt;
    }

    /**
     * Get createdAt
     *
     * @return datetime 
     */
    public function getCreatedAt()
    {
        return $this->createdAt;
    }
}

It looks like the generator doesn't check if an attribute is inherited and therefore is already defined.
If an attribute is found as inherited, the generation of the attribute, accessor and mutator should be skipped.

This bug is really annoying, especially when working with bigger objects.

Tested within Symfony2 v2.0.4

doctrine-common]
    git=http://github.com/doctrine/common.git
    version=2.1.2

[doctrine-dbal]
    git=http://github.com/doctrine/dbal.git
    version=2.1.3

[doctrine]
    git=http://github.com/doctrine/doctrine2.git
    version=2.1.2

-Chris

Comment by Benjamin Eberlei [ 09/Jan/12 ]

As per the help message of the entity generation inheritance generation is not yet supported and will not work.

Its planned for 2.3.

Follow DDC-1590 for current information.





[DDC-2003] DateTime conditions in Criteria objects result in errors Created: 31/Aug/12  Updated: 17/Sep/12  Resolved: 17/Sep/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: Git Master
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Josiah Truasheim Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

When using DateTime conditions in Criteria objects an error is thrown because of DateTime to string conversion. This is because the `matching` method doesn't use the same functionality as the `findBy` method.



 Comments   
Comment by Josiah Truasheim [ 31/Aug/12 ]

https://github.com/doctrine/doctrine2/pull/433 - PR





[DDC-1637] Linq-like Filter API for collections Created: 06/Feb/12  Updated: 09/Jul/12  Resolved: 09/Jul/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: New Feature Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 6
Labels: None


 Description   

We want an API that allows users to filter collections to subsets on the SQL level during the runtime (not using DQL).

Example:

class Post
{
   private $comments;
   public function getRecentComments()
   {
       return $this->comments->select(Expression::lessThan("commentDate", new \DateTime("-7 days")));
   }
}

The language of this Expressions for selecting entities out of a collection has to be so simple that it works on both arrays and any persistence backed data-source.

The Collection#select() method would return a new collection that is not equal the invoked collection.



 Comments   
Comment by Benjamin Eberlei [ 08/Feb/12 ]

First API example: https://gist.github.com/1766769

Comment by Benjamin Eberlei [ 16/Mar/12 ]

There is a PR now https://github.com/doctrine/common/pull/117

Comment by Benjamin Eberlei [ 09/Jul/12 ]

Implemented





[DDC-1616] SchemaTool - CreateCommand should dump "valid" SQL and omit ATTENTION line Created: 24/Jan/12  Updated: 22/Feb/12  Resolved: 22/Feb/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: Tools
Affects Version/s: Git Master
Fix Version/s: 2.3
Security Level: All

Type: Improvement Priority: Major
Reporter: Raphael Stolt Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None

Attachments: Text File fix_execute_schema_command.patch    

 Description   

When running "doctrine orm:schema-tool:create --dump-sql" it should not omit the semicolon of the last SQL statement (though the current SQL output is also valid and executable) and it should omit the ATTENTION line (or output it as an SQL commented line) as the schema isn't applied/created anyways.

This would make it much easier to write for e.g. the SQL schema to a file for further processing; but might also break systems (e.g. buildsystems) which have a workaround for the above mentioned shortcoming.



 Comments   
Comment by Guilherme Blanco [ 22/Feb/12 ]

Fixed by https://github.com/doctrine/doctrine2/commit/48dcee9d60459fce1542d11536d465f5d89cff55





[DDC-1606] Added fix for collection->contains with many-to-many extra lazy fetchMode Created: 17/Jan/12  Updated: 22/Jan/12  Resolved: 17/Jan/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.2.0-RC1, 2.2, 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Guilherme Blanco Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

That case previously triggered a PHP error along the lines of:

Notice: Undefined index: 0000000062a3a7690000000033c91b26 in doctrine/lib/Doctrine/ORM/UnitOfWork.php line 2202
#0 doctrine/lib/Doctrine/ORM/Persisters/ManyToManyPersister.php(267): Doctrine\ORM\UnitOfWork->getEntityIdentifier(Object(Item))
#1 doctrine/lib/Doctrine/ORM/PersistentCollection.php(411): Doctrine\ORM\Persisters\ManyToManyPersister->contains(Object(Doctrine\ORM\PersistentCollection), Object(Item))
#2 Test.php(71): Doctrine\ORM\PersistentCollection->contains(Object(Item))

Associated PR: https://github.com/doctrine/doctrine2/pull/259



 Comments   
Comment by Guilherme Blanco [ 17/Jan/12 ]

Merged in https://github.com/doctrine/doctrine2/commit/c1012f79706491e9dbf6c8741225b62833c6d2ce





[DDC-1608] Lazy load more restrict when consuming PersistentCollection trigger actions to *Persisters Created: 17/Jan/12  Updated: 18/Jan/12  Resolved: 18/Jan/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.2, 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Guilherme Blanco Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

Since https://github.com/doctrine/doctrine2/pull/259 we identified an issue with the Persisters that are failing to check for entities that exist in UoW (managed and sched for insert) and are now being checked is they are part of Collection.
Also it missed some tests. It should be easy, just ->persist the entity then triggers Collection actions.



 Comments   
Comment by Guilherme Blanco [ 18/Jan/12 ]

Fixed in https://github.com/doctrine/doctrine2/commit/d39760ba49418f42f235e9befe223896f11de4bd

Comment by Benjamin Eberlei [ 18/Jan/12 ]

Merged back to 2.2





[DDC-1596] Discriminator column has no table alias Created: 11/Jan/12  Updated: 13/Jan/12  Resolved: 13/Jan/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: Git Master
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Gandzy Ghennady Assignee: Guilherme Blanco
Resolution: Fixed Votes: 1
Labels: None

Attachments: Text File SingleTablePersister.diff    

 Description   

Some single table inheritance

Resource.php
/**
 * @Orm\Entity
 * @Orm\Table(name="resource")
 * @Orm\InheritanceType("SINGLE_TABLE")
 * @Orm\DiscriminatorColumn(name="type", type="string")
 * @Orm\DiscriminatorMap({"Container" = "Container", "News"="News"})
 */
abstract class Resource
{
}
$em->getRepository('News')->find($id)
/**
* generate SQL like this: 
* SELECT t0.id AS id1, t0.name AS name2, type FROM resource t0 WHERE t0.id = ? AND t0.type IN ('News')
*/

Column type has no table alias.
I expected SQL like this:

SELECT t0.id AS id1, t0.name AS name2, t0.type FROM resource t0 WHERE t0.id = ? AND t0.type IN ('News')

Proposed patch attached



 Comments   
Comment by Guilherme Blanco [ 13/Jan/12 ]

Fixed in https://github.com/doctrine/doctrine2/commit/bb1021198355871bd78b19c7795900be0020520b





[DDC-1567] GH-242: [UnderscoreNamingStrategy] fix docblock Created: 27/Dec/11  Updated: 28/Dec/11  Resolved: 28/Dec/11

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

Pull-Request was automatically synchronized: https://github.com/doctrine/doctrine2/pull/242



 Comments   
Comment by Benjamin Eberlei [ 28/Dec/11 ]

Resolved





[DDC-1562] GH-240: fix QueryDqlFunctionTest#testFunctionSubstring order Created: 23/Dec/11  Updated: 28/Dec/11  Resolved: 28/Dec/11

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

Pull-Request was automatically synchronized: https://github.com/doctrine/doctrine2/pull/240

Hello,

I got the same problem of #234

http://travis-ci.org/#!/FabioBatSilva/doctrine2/jobs/441187






[DDC-1557] SimpleSelectExpression does not accept DQL functions Created: 22/Dec/11  Updated: 29/Dec/11  Resolved: 29/Dec/11

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: DQL
Affects Version/s: 2.2
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Elnur Abdurrakhimov Assignee: Fabio B. Silva
Resolution: Fixed Votes: 0
Labels: None


 Description   
SELECT m 
FROM MealBundle:Meal m 
WHERE m.user = :user OR m.user IN (
    SELECT IDENTITY(s.to) 
    FROM SubscriptionBundle:Subscription s 
    WHERE s.from = :user
)

[Syntax Error] line 0, col 82: Error: Expected Doctrine\ORM\Query\Lexer::T_FROM, got '('



 Comments   
Comment by Benjamin Eberlei [ 29/Dec/11 ]

This issue is referenced in Github Pull-Request GH-246
https://github.com/doctrine/doctrine2/pull/246

Comment by Benjamin Eberlei [ 29/Dec/11 ]

Related Pull Request was closed: https://github.com/doctrine/doctrine2/pull/246

Comment by Guilherme Blanco [ 29/Dec/11 ]

Fixed in https://github.com/doctrine/doctrine2/commit/e43897916a001b6fe9cd8df27d6c9c272f41c854





[DDC-1542] GH-221: [Inheritance] Joined: Default discriminator map Created: 16/Dec/11  Updated: 04/May/12  Resolved: 04/May/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Improvement Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

Pull-Request was automatically synchronized: https://github.com/doctrine/doctrine2/pull/221

Hi all,

I know this topic was discussed a lot of times, but I wanted to give it a try anyway.

I want the discriminator map to be configured dynamically by doctrine instead of having to manually configure it myself. So I've digged into the code and the only place I've found (yet) to put the necessary code to make this happen is in the Drivers, just when they're loading the mapping information. So far, I've put a very simple piece of code in the AnnotationDriver to give it a try and I wrote a test for it. But before going on I wanted to ask you if it looks ok for you.

I've tested it in an application I'm working on and, so far, it works.

Two things come to mind though:

1) Is there any special case this would cause problems that I don't know of?
2) If not then, Is there a better place to put this code so I don't have to implement it in all drivers? I've been looking at the ClassMetadataFactory class but I didn't find a place to put this code because it seems it's too late to calculate the discriminator map at the time this class is used. So, in case there is no other place, where should I refactor the logic? It feels uncomfortable to create a class just to put this simple logic on, but as drivers don't inherit from any class, I don't see another option.

Thanks!



 Comments   
Comment by Benjamin Eberlei [ 28/Dec/11 ]

Mark as improvement and schedule for 2.3

Comment by Benjamin Eberlei [ 22/Mar/12 ]

A related Github Pull-Request [GH-221] was
https://github.com/doctrine/doctrine2/pull/221





[DDC-1529] Multiple FROM Entities and inheritance Created: 12/Dec/11  Updated: 19/Jan/12  Resolved: 19/Jan/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: DQL, ORM
Affects Version/s: 2.1.2
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Johan Dufour Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None
Environment:

Symfony 2



 Description   

I got a single table inheritance on an object Content (Program, Article, etc...)

when try a simple :

$query = $this->_em->createQuery('
SELECT a, p
FROM SG\CmsBundle\Entity\Article a, SG\ProgramBundle\Entity\Program p');
$query->getResult();

The generated sql is :

SELECT s0_.id AS id0, s0_.title AS title1, s0_.description AS description2, s0_.tags AS tags3, s0_.keywords AS keywords4, s0_.robots AS robots5, s0_.author_name AS author_name6, s0_.fb_description AS fb_description7, s0_.type AS type8, s0_.is_active AS is_active9, s0_.is_deleted AS is_deleted10, s0_.is_published AS is_published11, s0_.published_at AS published_at12, s0_.unpublished_at AS unpublished_at13, s0_.slug AS slug14, s0_.created_at AS created_at15, s0_.updated_at AS updated_at16, s0_.lft AS lft17, s0_.rgt AS rgt18, s0_.root AS root19, s0_.lvl AS lvl20, s1_.id AS id21, s1_.title AS title22, s1_.description AS description23, s1_.tags AS tags24, s1_.keywords AS keywords25, s1_.robots AS robots26, s1_.author_name AS author_name27, s1_.fb_description AS fb_description28, s1_.type AS type29, s1_.is_active AS is_active30, s1_.is_deleted AS is_deleted31, s1_.is_published AS is_published32, s1_.published_at AS published_at33, s1_.unpublished_at AS unpublished_at34, s1_.slug AS slug35, s1_.created_at AS created_at36, s1_.updated_at AS updated_at37, s1_.lft AS lft38, s1_.rgt AS rgt39, s1_.root AS root40, s1_.lvl AS lvl41, s0_.kind AS kind42, s0_.parent_id AS parent_id43, s0_.template_article_id AS template_article_id44, s0_.template_page_id AS template_page_id45, s0_.author_id AS author_id46, s1_.kind AS kind47, s1_.parent_id AS parent_id48, s1_.template_article_id AS template_article_id49, s1_.template_page_id AS template_page_id50, s1_.author_id AS author_id51 FROM sg_content s0_, sg_content s1_ WHERE (s0_.kind IN ('Article') AND AND s1_.kind IN ('Program'))

The only problem is, we got an extra AND at the end of the query, the query should look smthin like this :

SELECT ... WHERE (s0_.kind IN ('Article') AND s1_.kind IN ('Program'))



 Comments   
Comment by Guilherme Blanco [ 19/Jan/12 ]

Invalid for 2.2. I couldn't track the exact commit this was fixed, so I'll keep fix version for 2.3.
Coverage commit reference: https://github.com/doctrine/doctrine2/commit/febfe35c2315a20534630aa9e5b9c72a0047f569





[DDC-1497] Orm:generate-entities generates incorrect code when it has multiple relations with the same entity Created: 17/Nov/11  Updated: 27/May/12  Resolved: 27/May/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: Tools
Affects Version/s: 2.1.2
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Kéri Norbert Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 2
Labels: None
Environment:

ArchLinux, PHP 5.3.8



 Description   

Using the same entities, as in the cookbook, when you generate the entities, the add* methods on User, or generally, on the inverse for many type relations are incorrect, and overwrite each other, so you end up with only one add method, that is incorrectly named.

Rework\Model\User:
    type: entity
    table: user
    id:
        id:
            type: integer
            generator:
                strategy: AUTO
    fields:
        name:
            type: string
    oneToMany:
        reportedBugs:
            targetEntity: Bug
            mappedBy: reporter
        assignedBugs:
            targetEntity: Bug
            mappedBy: engineer

Rework\Model\Bug:
    type: entity
    table: bug
    id:
        id:
            type: integer
            generator:
                strategy: AUTO
    fields:
        name:
            type: string
    manyToOne:
        reporter:
            targetEntity: User
            inversedBy: reportedBugs
        engineer:
            targetEntity: User
            inversedBy: assignedBugs
The generated method on User.php
    /**
     * Add reportedBugs
     *
     * @param Rework\Model\Bug $reportedBugs
     */
    public function addBug(\Rework\Model\Bug $reportedBugs)
    {
        $this->reportedBugs[] = $reportedBugs;
    }

What I expected:
The method should be named addReportedBugs, eg. it should be named after the relation, and not the entity's classname.
There should also be two add* methods, instead there is only one.



 Comments   
Comment by venimus [ 17/Jan/12 ]

I also reproduce that with a manyToMany relations

The misbehavior I found to be in the EntityGenerator.php on lines 706-712

 
        if ($type == "add") {
            $addMethod = explode("\\", $typeHint);
            $addMethod = end($addMethod);
            $methodName = $type . $addMethod;
        } else {
            $methodName = $type . Inflector::classify($fieldName);
        }

the whole block should be simply

 $methodName = $type . Inflector::classify($fieldName); 
Comment by Schyzophrenic [ 31/Mar/12 ]

I have also reproduced the very same issue on Doctrine 2.1.4 on a Win7 environment (using Symfony2, but it is not really relevant here).
While waiting for a fix, I will use the provided workaround.

Comment by Benjamin Eberlei [ 27/May/12 ]

Fixed but merged only into master, since this is also a BC break.





[DDC-1939] Trying to save ManyToMany relatrionship Created: 23/Jul/12  Updated: 29/Jul/12  Resolved: 29/Jul/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.2
Fix Version/s: 2.2.3, 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Jeremie Tom tom Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: None

Attachments: File Membership.php     File Privileges.php     File UserAccount.php    

 Description   

When i try to save a many to many relationship i have to following error

Fatal error: Call to a member function getOwner() on a non-object in Doctrine/ORM/Persisters/ManyToManyPersister.php on line 181

It tries to call getOwner on the following array ($mapping)

array(19) {
["fieldName"] => string(10) "privileges"
["joinTable"] => array(4) {
["name"] => string(36) "fsbackend.user_mch_account_privilege"
["schema"] => NULL
["joinColumns"] => array(2) {
[0] => array(6)

{ ["name"] => string(13) "mch_accountid" ["referencedColumnName"] => string(13) "mch_accountid" ["unique"] => bool(false) ["nullable"] => bool(true) ["onDelete"] => NULL ["columnDefinition"] => NULL }

[1] => array(6)

{ ["name"] => string(3) "uid" ["referencedColumnName"] => string(3) "uid" ["unique"] => bool(false) ["nullable"] => bool(true) ["onDelete"] => NULL ["columnDefinition"] => NULL }

}
["inverseJoinColumns"] => array(1) {
[0] => array(6)

{ ["name"] => string(10) "resourceid" ["referencedColumnName"] => string(10) "resourceid" ["unique"] => bool(false) ["nullable"] => bool(true) ["onDelete"] => NULL ["columnDefinition"] => NULL }

}
}
["targetEntity"] => string(21) "Entity\User\Privilege"
["mappedBy"] => NULL
["inversedBy"] => NULL
["cascade"] => array(0) {
}
["indexBy"] => string(10) "resourceid"
["fetch"] => int(2)
["type"] => int(8)
["isOwningSide"] => bool(true)
["sourceEntity"] => string(26) "Entity\Merchant\Membership"
["isCascadeRemove"] => bool(false)
["isCascadePersist"] => bool(false)
["isCascadeRefresh"] => bool(false)
["isCascadeMerge"] => bool(false)
["isCascadeDetach"] => bool(false)
["relationToSourceKeyColumns"] => array(2)

{ ["mch_accountid"] => string(13) "mch_accountid" ["uid"] => string(3) "uid" }

["joinTableColumns"] => array(3)

{ [0] => string(13) "mch_accountid" [1] => string(3) "uid" [2] => string(10) "resourceid" }

["relationToTargetKeyColumns"] => array(1)

{ ["resourceid"] => string(10) "resourceid" }

}



 Comments   
Comment by Marco Pivetta [ 23/Jul/12 ]

Can you try to replace your cache with an `ArrayCache` and see if the problem may come from there?
It would also be interesting to see your bootstrap code and the code you use to interact with the collection.

Comment by Jeremie Tom tom [ 23/Jul/12 ]

I'm already using an ArrayCache for my cache.

Also for my bootstrap I'm using this implementation of it : https://github.com/guilhermeblanco/ZendFramework1-Doctrine2.

Here is how i interact with the collection.

$collection->clear();
foreach ($values as $value) {
$collection->add(
$this->_em->getReference(
'Entity\User\Privilege',
$value
));}

... Later on ...
... I have an entity $userAccount with many memberships set to Cascade persist, ....
... and on the membership entity relationship i have my collection ...

$this->_em->persist($userAccount);
$this->_em->flush();

Comment by Jeremie Tom tom [ 24/Jul/12 ]

I don't know if it helps but it works if I replace $mapping with $coll on line 181 :

$sourceClass = $this->_em->getClassMetadata(get_class($mapping->getOwner()));

Replaced by :

$sourceClass = $this->_em->getClassMetadata(get_class($coll->getOwner()));

Comment by Marco Pivetta [ 24/Jul/12 ]

Looks like code coming from the (removed) AssociationMapping class. The fix seems also to be valid. I'm patching this.

Comment by Marco Pivetta [ 24/Jul/12 ]

Nevermind, I don't think this needs a test. It is just something overlooked during a refactoring. Being handled at DDC-1941

Comment by Marco Pivetta [ 24/Jul/12 ]

Could you please provide the models anyway? It would be interesting to see why the test suite doesn't cover that part
Thank you!

Comment by Jeremie Tom tom [ 24/Jul/12 ]

Ok I attached it. Tell me if you need more informations i didn't upload the full models. But just the parts i thought were relevant.

Comment by Benjamin Eberlei [ 29/Jul/12 ]

Fixed and applied to 2.2.3 and 2.3





[DDC-1895] update an entity with an ID column which is a relation instead of a normal field Created: 27/Jun/12  Updated: 05/Jul/12  Resolved: 05/Jul/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: Mapping Drivers
Affects Version/s: Git Master
Fix Version/s: 2.2.3, 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Bart van den Burg Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

I got this error when trying to update an entity with an ID column which is a relation instead of a normal field: https://gist.github.com/3399c0ad5e0a44a29f98

Here is the relevant mapping:

<?php

namespace Roompot\TRSBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Samson\Bundle\TRSBundle\Entity\Registrar;

/**
 * @ORM\Entity
 */
class RegistrarDepartmentMapping
{
    /**
     * @ORM\ManyToOne(targetEntity="RoompotRegistrar")
     * @ORM\JoinColumn(referencedColumnName="person_id")
     * @ORM\Id
     */
    private $registrar;

    /**
     * @ORM\ManyToOne(targetEntity="Department")
     * @ORM\Id
     */
    private $department;

    /**
     * @ORM\Column(type="boolean")
     */
    private $head = false;

    public function getRegistrar()
    {
        return $this->registrar;
    }

    public function setRegistrar(Registrar $registrar)
    {
        if (null !== $this->registrar) {
            throw new \RuntimeException('Cannot change registrar! Remove this entity and create a new one');
        }
        $this->registrar = $registrar;
    }

    public function getDepartment()
    {
        if (null !== $this->registrar) {
            throw new \RuntimeException('Cannot change department! Remove this entity and create a new one');
        }
        return $this->department;
    }

    public function setDepartment(Department $department)
    {
        $this->department = $department;
    }

    public function isHead()
    {
        return $this->head;
    }

    public function setHead($head)
    {
        $this->head = $head;
    }
}
<?php

namespace Roompot\TRSBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Samson\Bundle\TRSBundle\Entity\Registrar;

/**
 * @ORM\Entity
 */
class RoompotRegistrar extends Registrar
{
    [...]
}
<?php

namespace Samson\Bundle\TRSBundle\Entity;

use Samson\Bundle\AddressBookBundle\Entity\Person;
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity 
 * @ORM\InheritanceType("SINGLE_TABLE")
 * @ORM\DiscriminatorColumn(name="discr", type="string")
 */
abstract class Registrar
{
    /**
     * @ORM\Id
     * @ORM\OneToOne(targetEntity="Samson\Bundle\AddressBookBundle\Entity\Person", cascade={"persist"})
     * @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
     */
    private $person;

    [...]
}
<?php

namespace Samson\Bundle\AddressBookBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity(repositoryClass="Samson\Bundle\AddressBookBundle\Entity\PersonRepository")
 */
class Person implements [...]
{
    /**
     * @ORM\Column(type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue
     */
    private $id;

    [...]
}

I was able to fix the error by updating BasicEntityPersister: https://github.com/SamsonIT/doctrine2/compare/fetching_id_column_if_relation



 Comments   
Comment by Benjamin Eberlei [ 05/Jul/12 ]

Fixed





[DDC-1885] Problem with column quoting on Delete Created: 20/Jun/12  Updated: 04/Jul/12  Resolved: 04/Jul/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.1.6
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Ignacio Larranaga Assignee: Fabio B. Silva
Resolution: Fixed Votes: 0
Labels: None

Attachments: File Role.php     File User.php    

 Description   

delete($entity) from BasicEntityPersiter is not considering that the columns might be quoted.

public function delete($entity) {
	$identifier = $this->_em->getUnitOfWork()->getEntityIdentifier($entity);
        $this->deleteJoinTableRecords($identifier);

        $id = array_combine($this->_class->getIdentifierColumnNames(), $identifier);
        $this->_conn->delete($this->_class->getQuotedTableName($this->_platform), $id);
}

The third line:

        $id = array_combine($this->_class->getIdentifierColumnNames(), $identifier);
        // might be fixed in this way (as example):
        foreach ($identifier as $columnName => $value) {
                $id[$this->_class->getQuotedColumnName($columnName, $this->_platform)] = $value;
        }


 Comments   
Comment by Fabio B. Silva [ 20/Jun/12 ]

code format

Comment by Fabio B. Silva [ 20/Jun/12 ]

Hi Ignacio,

I think it will be fixed by :
https://github.com/doctrine/doctrine2/pull/372

Anyway could you attach a test case for this one please ?

Comment by Ignacio Larranaga [ 25/Jun/12 ]

Hi Fabio, sorry I doesn't have a test case written

Comment by Fabio B. Silva [ 25/Jun/12 ]

Hi Ignacio,

No problem, could you attach your entities ?

Thanks

Comment by Ignacio Larranaga [ 25/Jun/12 ]

User and Role, and I was just adding a role and updateing.
The database is PostgresSQL.

Comment by Fabio B. Silva [ 26/Jun/12 ]

Thanks Ignacio,

I'm working on this problem.

Comment by Fabio B. Silva [ 04/Jul/12 ]

Fixed by : https://github.com/doctrine/doctrine2/commit/4bfdcd32f7548c628fc393e36bf37ef8b97a80a8





[DDC-1880] Named Queries not processed correctly in XML Created: 18/Jun/12  Updated: 22/Jun/12  Resolved: 22/Jun/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: 2.2.2
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Josiah Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

When attempting to define named queries in XML mapping, they are not correctly passed through to the ClassMetadataInfo instance.

This is because the attribute syntax ($xmlRoot['named-queries']) is used instead of the child element syntax ({{$xmlRoot->

{'named-queries'}

}}).



 Comments   
Comment by Josiah [ 18/Jun/12 ]

Added a PR for this issue https://github.com/doctrine/doctrine2/pull/378

Comment by Guilherme Blanco [ 22/Jun/12 ]

As per GitHub resolution





[DDC-1849] Paginator: The Parameter Types are not set in Function cloneQuery Created: 31/May/12  Updated: 22/Jun/12  Resolved: 22/Jun/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: Tools
Affects Version/s: 2.2.2
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Aline Blaser Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

The Parameter-Types are not set in the Function cloneQuery in the Paginator-Class (Doctrine/ORM/Tools/Pagination/Paginator.php line 172):

$cloneQuery->setParameters($query->getParameters());

But it should be:

$cloneQuery->setParameters($query->getParameters(), $query->getParameterTypes());



 Comments   
Comment by Marco Pivetta [ 10/Jun/12 ]

Could you try to use latest master? This should already be solved as now parameters are instances of `Doctrine\ORM\Query\Parameter`, which also means that they enclose their type

Comment by Guilherme Blanco [ 22/Jun/12 ]

Fixed in master





[DDC-1839] [GH-358] Update license for Composer Created: 26/May/12  Updated: 27/May/12  Resolved: 27/May/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of jalliot:

Url: https://github.com/doctrine/doctrine2/pull/358

Message:



 Comments   
Comment by Benjamin Eberlei [ 26/May/12 ]

A related Github Pull-Request [GH-358] was closed
https://github.com/doctrine/doctrine2/pull/358





[DDC-1827] [GH-350] Added the branch-alias in the composer.json Created: 20/May/12  Updated: 22/May/12  Resolved: 22/May/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of stof:

Url: https://github.com/doctrine/doctrine2/pull/350

Message:

depends on doctrine/dbal#151



 Comments   
Comment by Benjamin Eberlei [ 20/May/12 ]

A related Github Pull-Request [GH-350] was closed
https://github.com/doctrine/doctrine2/pull/350





[DDC-1826] [GH-349] Fix DDC-1822 Created: 19/May/12  Updated: 22/May/12  Resolved: 22/May/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of FabioBatSilva:

Url: https://github.com/doctrine/doctrine2/pull/349

Message:

http://www.doctrine-project.org/jira/browse/DDC-1822



 Comments   
Comment by Benjamin Eberlei [ 20/May/12 ]

A related Github Pull-Request [GH-349] was closed
https://github.com/doctrine/doctrine2/pull/349





[DDC-1823] Error with IN and UPPER in the same line Created: 17/May/12  Updated: 27/May/12  Resolved: 27/May/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: DQL
Affects Version/s: 2.1.6
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Aitor Suso Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

I have a problem making a DQL query

SELECT c.id, c.name
FROM BrandBundle:Brand c
WHERE UPPER(c.name) IN (:values)

:values is an array of possible names of brands.

The error shown is

[Syntax Error] line 0, col 109: Error: Expected Doctrine\ORM\Query\Lexer::T_IN, got '('



 Comments   
Comment by Guilherme Blanco [ 27/May/12 ]

This is already fixed in master for a long time and should be available in 2.3, since it requires major changes in DQL.





[DDC-1822] Intermediary parent for NoResult and NonUnique Exceptions Created: 16/May/12  Updated: 20/May/12  Resolved: 20/May/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Improvement Priority: Major
Reporter: Rafael Dohms Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

I would like to propose a intermediary parent for the NoResult and NonUnique Exceptions, that is not as high level as ORMEXception, something in between.

The reasoning for this is that sometime si want to get a single object out of the DB, and in case its not there i want to just get a null and carry on. For this I usually need to catch both exceptions as both results might trigger me to do something else, like abort. In some cases i do need to treat each of these in its own way, but in some cases it does not matter to which side the error went, it only matters that its not the expected SingleResult. Catching a ORMException is not adequate as it may include other error which would need to be treated differently.

My proposal would be like:

ORMException -> NotExpectedResultException ->

{NoResult, NonUnique}

Just a more detailed grouping of exceptions. Does this sound like something possible, or am I just nuts?



 Comments   
Comment by Guilherme Blanco [ 20/May/12 ]

Fixed in https://github.com/doctrine/doctrine2/commit/3d8e46447a4fa8871bd268e8ad69820c636e0dea





[DDC-1791] Paginator query doesn't work using Oracle Created: 19/Apr/12  Updated: 27/May/12  Resolved: 27/May/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.2.2
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Marc Drolet Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None
Environment:

linux using an oracle database



 Description   

Ive build a dql query using the queryBuilder and I've passed the queryBuilder to the Paginator object. The sql query failed.

here is the sql query that get executed:

SELECT a.*
FROM
(
SELECT DISTINCT ID0
FROM
(
SELECT
f0_.id AS ID0, f0_.title AS TITLE1,
f1_.id AS ID2,
f2_.id AS ID3, f2_.first_name AS FIRST_NAME4, f2_.middle_name AS MIDDLE_NAME5, f2_.last_name AS LAST_NAME6, f2_.phone AS PHONE7, f2_.url AS URL8,
f2_.email AS EMAIL9, f2_.profile AS PROFILE10, f2_.created_date AS CREATED_DATE11, f2_.last_updated_date AS LAST_UPDATED_DATE12,
f2_.object_status_id AS OBJECT_STATUS_ID13, f2_.published_date AS PUBLISHED_DATE14, f2_.publishing_status_id AS PUBLISHING_STATUS_ID15,
f3_.id AS ID16, f3_.title AS TITLE17, f3_.start_date AS START_DATE18, f3_.end_date AS END_DATE19,
f4_.id AS ID20, f4_.name AS NAME21,
f5_.id AS ID22,
c6_.id AS ID23,
d7_.id AS ID24
FROM fo_deal f0_
INNER JOIN fo_deal_role f1_ ON f0_.id = f1_.deal_id
INNER JOIN fo_people f2_ ON f1_.people_id = f2_.id
INNER JOIN fo_position f3_ ON f2_.id = f3_.people_id
INNER JOIN fo_company f4_ ON f3_.company_id = f4_.id
LEFT JOIN fo_people_asset f5_ ON f2_.id = f5_.people_id
LEFT JOIN co_asset c6_ ON f5_.asset_id = c6_.id
LEFT JOIN ds_record d7_ ON c6_.ds_id = d7_.id
WHERE f2_.object_status_id <> 3
AND f2_.publishing_status_id = 2
ORDER BY f0_.published_date DESC
) AS _dctrn_result
) a
WHERE ROWNUM <= 3

It seems that oracle doesn't accept the AS _dctrn_result. if I remove the AS _dctrn_result in the query, the query works and I get the proper information.



 Comments   
Comment by Marc Drolet [ 19/Apr/12 ]

Here is the error message sent by oracle:
ORA-00907: missing right parenthesis
00907. 00000 - "missing right parenthesis"
*Cause:
*Action:
Error at Line: 29 Column: 4

Also, if I remove the keyword AS, and let the _dctrn_result, I get the error:
ORA-00911: invalid character
00911. 00000 - "invalid character"
*Cause: identifiers may not start with any ASCII character other than
letters and numbers. $#_ are also allowed after the first
character. Identifiers enclosed by doublequotes may contain
any character other than a doublequote. Alternative quotes
(q'#...#') cannot use spaces, tabs, or carriage returns as
delimiters. For all other contexts, consult the SQL Language
Reference Manual.
*Action:
Error at Line: 29 Column: 4

So, If I remove the _ from the alias it work.

Comment by Marc Drolet [ 19/Apr/12 ]

here is the fix I've done on my local environment:

ORM/Tools/Pagination/LimitSubqueryOutputWalker.php line 126

I've remove the AS _dctrn_result alias from the query.

I've grep for dctrn_result into the ORM directory and I didn't find any occurence of dctrn_result, so it's not used anywhere.

Comment by Marc Drolet [ 19/Apr/12 ]

I would also point out the the result that I get is not correct when we use an order by clause.

To get the correct result when an order by clause is provided, I need to add another level of query.
here is the query that need to be executed to get the result in the proper order by clause.

SELECT a.*
FROM
(
select b.*, rownum as rn
from
(
SELECT DISTINCT ID0
FROM
(
SELECT
f0_.id AS ID0, f0_.title AS TITLE1,
f1_.id AS ID2,
f2_.id AS ID3, f2_.first_name AS FIRST_NAME4, f2_.middle_name AS MIDDLE_NAME5, f2_.last_name AS LAST_NAME6, f2_.phone AS PHONE7, f2_.url AS URL8,
f2_.email AS EMAIL9, f2_.profile AS PROFILE10, f2_.created_date AS CREATED_DATE11, f2_.last_updated_date AS LAST_UPDATED_DATE12,
f2_.object_status_id AS OBJECT_STATUS_ID13, f2_.published_date AS PUBLISHED_DATE14, f2_.publishing_status_id AS PUBLISHING_STATUS_ID15,
f3_.id AS ID16, f3_.title AS TITLE17, f3_.start_date AS START_DATE18, f3_.end_date AS END_DATE19,
f4_.id AS ID20, f4_.name AS NAME21,
f5_.id AS ID22,
c6_.id AS ID23,
d7_.id AS ID24
FROM fo_deal f0_
INNER JOIN fo_deal_role f1_ ON f0_.id = f1_.deal_id
INNER JOIN fo_people f2_ ON f1_.people_id = f2_.id
INNER JOIN fo_position f3_ ON f2_.id = f3_.people_id
INNER JOIN fo_company f4_ ON f3_.company_id = f4_.id
LEFT JOIN fo_people_asset f5_ ON f2_.id = f5_.people_id
LEFT JOIN co_asset c6_ ON f5_.asset_id = c6_.id
LEFT JOIN ds_record d7_ ON c6_.ds_id = d7_.id
WHERE f2_.object_status_id <> 3
AND f2_.publishing_status_id = 2
ORDER BY f0_.deal_date DESC, f0_.published_date DESC
) dctrn_result
) b
) a
WHERE a.rn <= 3

Comment by Marc Drolet [ 19/Apr/12 ]

I've fix the limit order by issue (for oracle only)

here is the change I've made to the file: ORM/Tools/Pagination/LimitSubqueryOutputWalker.php
method: walkSelectStatement
starting at lime 129.

I've replace this code:
$sql = $this->platform->modifyLimitQuery(
$sql, $this->maxResults, $this->firstResult
);

for this one:
if ($this->firstResult > 0)

{ $sql = 'SELECT * FROM ( SELECT a.*, rownum AS doctrine_rownum FROM (' . $sql . ') a WHERE a.rn >= ' . ($this->firstResult + 1) . ' ) WHERE doctrine_rownum >= ' . $this->maxResults; }

else

{ $sql = 'SELECT a.* FROM (' . $sql . ') a WHERE a.rn <= ' . $this->maxResults; }
Comment by Marc Drolet [ 23/Apr/12 ]

The countOutputWalker also need to be modified.

file: Doctrine/ORM/Tools/Pagination/CountOutputWalker.php
method: walkSelectStatement

for oracle it doesn't work:
return sprintf('SELECT %s AS _dctrn_count FROM (SELECT DISTINCT %s FROM (%s) AS _dctrn_result) AS _dctrn_table',

need to be changed for:
return sprintf('SELECT %s AS DCTRN_COUNT FROM (SELECT DISTINCT %s FROM (%s) DCTRN_RESULT) DCTRN_TABLE',

I want to point out the I've change the alias to UPPER CASE, cause oracle return the array result with field names in upper case.
This affect the count method of the file Doctrine/ORM/Tools/Pagination/Paginator.php that need to be modified.

file: Doctrine/ORM/Tools/Pagination/Paginator.php
method: count
line: 131 change $rsm->addScalarResult('_dctrn_count', 'count'); for $rsm->addScalarResult('DCTRN_COUNT', 'count');

Comment by Benjamin Eberlei [ 27/May/12 ]

Fixed, you are not using 2.2.2 btw, this code is only in master.





[DDC-1781] [GH-337] Removed dependency on common as required by dbal anyway Created: 17/Apr/12  Updated: 17/Apr/12  Resolved: 17/Apr/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of richardmiller:

Url: https://github.com/doctrine/doctrine2/pull/337

Message:

Not sure if this is the way to resolve this problem or not but I just tried to install dev-master using composer, doctrine/dbal and doctrine/common are both required in the "dev-master" versions but doctrine/dbal requires doctrine/common: >=2.2.0,<=2.2.99 which causes a conflict. Removing the dependency on doctrine/common would allow doctrine/dbal to install the version it requires. If this is not an ok solution then is there an alternative one?



 Comments   
Comment by Benjamin Eberlei [ 17/Apr/12 ]

A related Github Pull-Request [GH-337] was closed
https://github.com/doctrine/doctrine2/pull/337





[DDC-1766] Reintroduce old result cache as hydration cache Created: 04/Apr/12  Updated: 07/Apr/12  Resolved: 07/Apr/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: None
Fix Version/s: 2.2.2, 2.3
Security Level: All

Type: New Feature Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

The old result cache should be reintroduced as hydration cache, since it obviously is much faster than just result caching by avoiding hydration.

        $users = $this->_em->createQuery($dql)
                      ->setHydrationCacheProfile(new QueryCacheProfile(null, null, $cache))
                      ->getResult();


 Comments   
Comment by Benjamin Eberlei [ 07/Apr/12 ]

Implemented Hydration Cache.





[DDC-1768] [GH-330] improved exception message Created: 05/Apr/12  Updated: 04/May/12  Resolved: 04/May/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of schmittjoh:

Url: https://github.com/doctrine/doctrine2/pull/330

Message:

This makes the exception message more helpful. Before you were basically searching a needle in a haystack.

Note that I haven't been able to run the tests because I don't have PHPUnit 3.6 atm, so please check before merging.



 Comments   
Comment by Benjamin Eberlei [ 06/Apr/12 ]

A related Github Pull-Request [GH-330] was synchronize
https://github.com/doctrine/doctrine2/pull/330

Comment by Benjamin Eberlei [ 07/Apr/12 ]

A related Github Pull-Request [GH-330] was synchronize
https://github.com/doctrine/doctrine2/pull/330





[DDC-1763] Fixing a bug when calling setDiscriminatorMap from multiple sources (ie: from Events::loadClassMetadata and annotation). Created: 04/Apr/12  Updated: 07/Apr/12  Resolved: 07/Apr/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.1.6, 2.2, Git Master
Fix Version/s: 2.1.7, 2.2.2, 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Matyas Somfai Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 1
Labels: None


 Description   

We tried to set discriminator map in https://github.com/Netpositive/NetpositiveDiscriminatorMapBundle both from Events::loadClassMetadata and annotation.

Pull request created on 2.1.x, 2.2, master branches.



 Comments   
Comment by Peter Buri [ 05/Apr/12 ]

Pull requests:

https://github.com/doctrine/doctrine2/pull/326
https://github.com/doctrine/doctrine2/pull/327
https://github.com/doctrine/doctrine2/pull/328





[DDC-1764] [GH-326] 2.1.x setDiscriminatorMap fix Created: 04/Apr/12  Updated: 07/Apr/12  Resolved: 07/Apr/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.1.7, 2.2.2, 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of smatyas:

Url: https://github.com/doctrine/doctrine2/pull/326

Message:

Fixing a bug when calling setDiscriminatorMap from multiple sources (ie: from Events::loadClassMetadata and annotation).

http://www.doctrine-project.org/jira/browse/DDC-1763



 Comments   
Comment by Benjamin Eberlei [ 04/Apr/12 ]

A related Github Pull-Request [GH-327] was opened
https://github.com/doctrine/doctrine2/pull/327

Comment by Benjamin Eberlei [ 04/Apr/12 ]

A related Github Pull-Request [GH-328] was opened
https://github.com/doctrine/doctrine2/pull/328

Comment by Benjamin Eberlei [ 04/Apr/12 ]

A related Github Pull-Request [GH-328] was synchronize
https://github.com/doctrine/doctrine2/pull/328

Comment by Benjamin Eberlei [ 06/Apr/12 ]

A related Github Pull-Request [GH-328] was synchronize
https://github.com/doctrine/doctrine2/pull/328

Comment by Benjamin Eberlei [ 07/Apr/12 ]

A related Github Pull-Request [GH-327] was synchronize
https://github.com/doctrine/doctrine2/pull/327

Comment by Benjamin Eberlei [ 07/Apr/12 ]

A related Github Pull-Request [GH-328] was synchronize
https://github.com/doctrine/doctrine2/pull/328

Comment by Benjamin Eberlei [ 07/Apr/12 ]

A related Github Pull-Request [GH-327] was closed
https://github.com/doctrine/doctrine2/pull/327

Comment by Benjamin Eberlei [ 07/Apr/12 ]

A related Github Pull-Request [GH-328] was closed
https://github.com/doctrine/doctrine2/pull/328

Comment by Benjamin Eberlei [ 07/Apr/12 ]

A related Github Pull-Request [GH-326] was closed
https://github.com/doctrine/doctrine2/pull/326





[DDC-1757] DQL exception when building query with multiple from and join parts Created: 03/Apr/12  Updated: 27/May/12  Resolved: 27/May/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: Git Master
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Aigars Gedroics Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None

Attachments: File DDC1757Test.php     Text File patch-1757.patch    

 Description   

Query builder creates bad DQL if multiple FROM and JOIN parts are used.

As example such query builder code

$qb->from('A', 'a')
  ->from('B', 'b')
  ->join('b.c', 'c')
  ->join('c.d', 'd');

will generate DQL

...
  FROM A a 
    INNER JOIN c.d d, 
  B b 
    INNER JOIN b.c c
...

but should generate this instead

...
  FROM A a,
  B b 
    INNER JOIN b.c c 
    INNER JOIN c.d d
...

The DQL parser raises exception

Doctrine\ORM\Query\QueryException: [Semantical Error] line 0, col 61 near '.d d, B': Error: Identification Variable c used in join path expression but was not defined before.


 Comments   
Comment by Aigars Gedroics [ 03/Apr/12 ]

The test case attached.
The problem is that for the relation c.d the query builder uses the first root entity as the master which makes it to be included before the join b.c.

Comment by Aigars Gedroics [ 03/Apr/12 ]

Dirty patch attached.

Comment by Benjamin Eberlei [ 27/May/12 ]

This was fixed through a PR some weeks ago.





[DDC-1752] [GH-321] Addition for new cache driver Created: 02/Apr/12  Updated: 07/Apr/12  Resolved: 07/Apr/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of import:

Url: https://github.com/doctrine/doctrine2/pull/321

Message:

New cache driver addition for Doctrine running in ```non-dev``` mode and cache driver is not set.
This cache driver (Redis) was added with doctrine/common#109



 Comments   
Comment by Benjamin Eberlei [ 04/Apr/12 ]

A related Github Pull-Request [GH-321] was synchronize
https://github.com/doctrine/doctrine2/pull/321

Comment by Benjamin Eberlei [ 06/Apr/12 ]

A related Github Pull-Request [GH-321] was synchronize
https://github.com/doctrine/doctrine2/pull/321

Comment by Benjamin Eberlei [ 07/Apr/12 ]

A related Github Pull-Request [GH-321] was closed
https://github.com/doctrine/doctrine2/pull/321

Comment by Benjamin Eberlei [ 07/Apr/12 ]

Merged





[DDC-1746] Throw Exception when setting unknown cascade option Created: 01/Apr/12  Updated: 01/Apr/12  Resolved: 01/Apr/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Improvement Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

See DDC-1742



 Comments   
Comment by Benjamin Eberlei [ 01/Apr/12 ]

Implemented





[DDC-1743] [GH-315] [WIP] Allowing proxies to be passed to ORM public API Created: 31/Mar/12  Updated: 04/May/12  Resolved: 04/May/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of Ocramius:

Url: https://github.com/doctrine/doctrine2/pull/315

Message:

Basically, following happens:

```php
$proxy = some_unserialization();
$em->persist($proxy); // exception because the class name is not recognized
```

Fortunately, just some replacements of `get_class($entity)` with `Doctrine\Common\Util\ClassUtils::getClass($entity)` fix the issue.

I wanted to leave this as [WIP] because I need some feedback on the test cases. All three tests fail without the patch, while [![Build Status](https://secure.travis-ci.org/Ocramius/doctrine2.png?branch=getclass-on-proxies-refactoring)](http://travis-ci.org/Ocramius/doctrine2) with it applied.

What is a bit tricky is the status of the proxies.

Cases where `$_initialized_ = false;` && `$_identifier = array();` and others fail because of notices and weird issues that are very difficult to hunt down. That is because of the strange nature of proxies obviously. I just wanted to know if this should be somehow fixed in here.

Another issue is probably performance, as there is some minor overhead introduced. What I'd like to know is if https://github.com/doctrine/common/blob/master/lib/Doctrine/Common/Util/ClassUtils.php#L56 could be reduced to a `if ($object instanceof Proxy)

{ ... }

`.



 Comments   
Comment by Benjamin Eberlei [ 31/Mar/12 ]

A related Github Pull-Request [GH-315] was synchronize
https://github.com/doctrine/doctrine2/pull/315

Comment by Benjamin Eberlei [ 01/Apr/12 ]

A related Github Pull-Request [GH-315] was synchronize
https://github.com/doctrine/doctrine2/pull/315

Comment by Benjamin Eberlei [ 01/Apr/12 ]

A related Github Pull-Request [GH-315] was synchronize
https://github.com/doctrine/doctrine2/pull/315

Comment by Benjamin Eberlei [ 04/Apr/12 ]

A related Github Pull-Request [GH-315] was synchronize
https://github.com/doctrine/doctrine2/pull/315

Comment by Benjamin Eberlei [ 06/Apr/12 ]

A related Github Pull-Request [GH-315] was synchronize
https://github.com/doctrine/doctrine2/pull/315

Comment by Benjamin Eberlei [ 07/Apr/12 ]

A related Github Pull-Request [GH-315] was synchronize
https://github.com/doctrine/doctrine2/pull/315





[DDC-1736] [GH-313] Fixed tests on Windows Created: 29/Mar/12  Updated: 30/Mar/12  Resolved: 30/Mar/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of hason:

Url: https://github.com/doctrine/doctrine2/pull/313

Message:



 Comments   
Comment by Benjamin Eberlei [ 29/Mar/12 ]

A related Github Pull-Request [GH-313] was closed
https://github.com/doctrine/doctrine2/pull/313





[DDC-1725] [GH-309] Fix DDC-1686 Created: 25/Mar/12  Updated: 30/Mar/12  Resolved: 30/Mar/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of FabioBatSilva:

Url: https://github.com/doctrine/doctrine2/pull/309

Message:



 Comments   
Comment by Benjamin Eberlei [ 25/Mar/12 ]

A related Github Pull-Request [GH-309] was synchronize
https://github.com/doctrine/doctrine2/pull/309

Comment by Benjamin Eberlei [ 26/Mar/12 ]

A related Github Pull-Request [GH-309] was closed
https://github.com/doctrine/doctrine2/pull/309





[DDC-1696] String support in THEN and ELSE part of CASE expression is broken Created: 11/Mar/12  Updated: 12/Mar/12  Resolved: 12/Mar/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: DQL
Affects Version/s: 2.2
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Alexander Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

The SQL generated when using strings in the THEN and ELSE parts of the CASE expression are not valid.

This testcase will fail:
$this->assertSqlGeneration(
"SELECT g.id, CASE WHEN ((g.id / 2) > 18) THEN 'Foo' ELSE 'Bar' END AS test FROM Doctrine\Tests\Models\CMS\CmsGroup g",
"SELECT c0_.id AS id0, CASE WHEN (c0_.id / 2 > 18) THEN 'Foo' ELSE 'Bar' END AS sclr1 FROM cms_groups c0_"
);

Noticed by a user at github:
https://github.com/doctrine/doctrine2/pull/277
https://github.com/doctrine/doctrine2/pull/278



 Comments   
Comment by Guilherme Blanco [ 12/Mar/12 ]

Fixed by https://github.com/doctrine/doctrine2/commit/795438670517cd7a4e76bca6dd33fdc9bbb5d988

@beberlei please merge in 2.2! =D





[DDC-1685] Using the CountWalker on an entity with ID on OneToOne field fails Created: 06/Mar/12  Updated: 27/May/12  Resolved: 27/May/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: Git Master
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Bart van den Burg Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None
Environment:

any



 Description   

When using the CountWalker on an entity which has @Id not on a column, but on a @OneToOne property, a fatal error occurs:

Notice: Undefined index: person in D:\workspace9\roompot\vendor\doctrine\lib\Doctrine\ORM\Mapping\ClassMetadataInfo.php line 2301

In this case I'm using the Paginator by KnpLabs. Here is the trace:

Trace
Notice: Undefined index: person in D:\workspace9\roompot\vendor\doctrine\lib\Doctrine\ORM\Mapping\ClassMetadataInfo.php line 2301
500 Internal Server Error - ErrorException

Stack Trace
in D:\workspace9\roompot\vendor\symfony\src\Symfony\Component\HttpKernel\Debug\ErrorHandler.php at line 65   
        }
        if (error_reporting() & $level && $this->level & $level) {
            throw new \ErrorException(sprintf('%s: %s in %s line %d', isset($this->levels[$level]) ? $this->levels[$level] : $level, $message, $file, $line));
        }
        return false;
at ErrorHandler ->handle ('8', 'Undefined index: person', 'D:\workspace9\roompot\vendor\doctrine\lib\Doctrine\ORM\Mapping\ClassMetadataInfo.php', '2301', array('field' => 'person', 'platform' => object(MySqlPlatform))) 
in D:\workspace9\roompot\vendor\doctrine\lib\Doctrine\ORM\Mapping\ClassMetadataInfo.php at line 2301    
at ClassMetadataInfo ->getQuotedColumnName ('person', object(MySqlPlatform)) 
in D:\workspace9\roompot\vendor\doctrine\lib\Doctrine\ORM\Query\SqlWalker.php at line 548    
at SqlWalker ->walkPathExpression (object(PathExpression)) 
in D:\workspace9\roompot\vendor\doctrine\lib\Doctrine\ORM\Query\AST\PathExpression.php at line 56    
at PathExpression ->dispatch (object(SqlWalker)) 
in D:\workspace9\roompot\vendor\doctrine\lib\Doctrine\ORM\Query\SqlWalker.php at line 2126    
at SqlWalker ->walkArithmeticPrimary (object(PathExpression)) 
in D:\workspace9\roompot\vendor\doctrine\lib\Doctrine\ORM\Query\SqlWalker.php at line 2105    
at SqlWalker ->walkArithmeticFactor (object(PathExpression)) 
in D:\workspace9\roompot\vendor\doctrine\lib\Doctrine\ORM\Query\SqlWalker.php at line 2084    
at SqlWalker ->walkArithmeticTerm (object(PathExpression)) 
in D:\workspace9\roompot\vendor\doctrine\lib\Doctrine\ORM\Query\SqlWalker.php at line 2061    
at SqlWalker ->walkSimpleArithmeticExpression (object(PathExpression)) 
in D:\workspace9\roompot\vendor\doctrine\lib\Doctrine\ORM\Query\SqlWalker.php at line 1408    
at SqlWalker ->walkAggregateExpression (object(AggregateExpression)) 
in D:\workspace9\roompot\vendor\doctrine\lib\Doctrine\ORM\Query\AST\AggregateExpression.php at line 50    
at AggregateExpression ->dispatch (object(SqlWalker)) 
in D:\workspace9\roompot\vendor\doctrine\lib\Doctrine\ORM\Query\SqlWalker.php at line 1139    
at SqlWalker ->walkSelectExpression (object(SelectExpression)) 
at array_map (array(object(SqlWalker), 'walkSelectExpression'), array(object(SelectExpression))) 
in D:\workspace9\roompot\vendor\doctrine\lib\Doctrine\ORM\Query\SqlWalker.php at line 596    
at SqlWalker ->walkSelectClause (object(SelectClause)) 
in D:\workspace9\roompot\vendor\doctrine\lib\Doctrine\ORM\Query\SqlWalker.php at line 417    
at SqlWalker ->walkSelectStatement (object(SelectStatement)) 
in D:\workspace9\roompot\vendor\doctrine\lib\Doctrine\ORM\Query\Exec\SingleSelectExecutor.php at line 38    
at SingleSelectExecutor ->__construct (object(SelectStatement), object(SqlWalker)) 
in D:\workspace9\roompot\vendor\doctrine\lib\Doctrine\ORM\Query\SqlWalker.php at line 192    
at SqlWalker ->getExecutor (object(SelectStatement)) 
in D:\workspace9\roompot\vendor\doctrine\lib\Doctrine\ORM\Query\Parser.php at line 325    
at Parser ->parse () 
in D:\workspace9\roompot\vendor\doctrine\lib\Doctrine\ORM\Query.php at line 230    
at Query ->_parse () 
in D:\workspace9\roompot\vendor\doctrine\lib\Doctrine\ORM\Query.php at line 241    
at Query ->_doExecute () 
in D:\workspace9\roompot\vendor\doctrine\lib\Doctrine\ORM\AbstractQuery.php at line 643    
at AbstractQuery ->execute (array(), '2') 
in D:\workspace9\roompot\vendor\doctrine\lib\Doctrine\ORM\AbstractQuery.php at line 468    
at AbstractQuery ->getResult ('2') 
in D:\workspace9\roompot\vendor\knp-components\src\Knp\Component\Pager\Event\Subscriber\Paginate\Doctrine\ORM\QuerySubscriber.php at line 45    
at QuerySubscriber ->items (object(ItemsEvent)) 
at call_user_func (array(object(QuerySubscriber), 'items'), object(ItemsEvent)) 
in D:\workspace9\roompot\vendor\symfony\src\Symfony\Bundle\FrameworkBundle\Debug\TraceableEventDispatcher.php at line 124    
at TraceableEventDispatcher ->doDispatch (array(array(object(QueryBuilderSubscriber), 'items'), array(object(QueryBuilderSubscriber), 'items'), array(object(QuerySubscriber), 'items'), array(object(QuerySubscriber), 'items'), array(object(QuerySubscriber), 'items'), array(object(QuerySubscriber), 'items'), array(object(CollectionSubscriber), 'items'), array(object(PropelQuerySubscriber), 'items'), array(object(SolariumQuerySubscriber), 'items'), array(object(ArraySubscriber), 'items')), 'knp_pager.items', object(ItemsEvent)) 
in D:\workspace9\roompot\app\cache\sitwst05_roompot\classes.php at line 3996    
at EventDispatcher ->dispatch ('knp_pager.items', object(ItemsEvent)) 
in D:\workspace9\roompot\app\cache\sitwst05_roompot\classes.php at line 5125    
at ContainerAwareEventDispatcher ->dispatch ('knp_pager.items', object(ItemsEvent)) 
in D:\workspace9\roompot\vendor\symfony\src\Symfony\Bundle\FrameworkBundle\Debug\TraceableEventDispatcher.php at line 72    
at TraceableEventDispatcher ->dispatch ('knp_pager.items', object(ItemsEvent)) 
in D:\workspace9\roompot\vendor\knp-components\src\Knp\Component\Pager\Paginator.php at line 76    
at Paginator ->paginate (object(Query), '1', '25') 
in D:\workspace9\roompot\src\Samson\TRSBundle\Controller\RegistrarController.php at line 34    
at RegistrarController ->indexAction () 
at call_user_func_array (array(object(RegistrarController), 'indexAction'), array()) 
in D:\workspace9\roompot\app\cache\sitwst05_roompot\classes.php at line 4241    
at HttpKernel ->handleRaw (object(Request), '1') 
in D:\workspace9\roompot\app\cache\sitwst05_roompot\classes.php at line 4205    
at HttpKernel ->handle (object(Request), '1', true) 
in D:\workspace9\roompot\app\cache\sitwst05_roompot\classes.php at line 5192    
at HttpKernel ->handle (object(Request), '1', true) 
in D:\workspace9\roompot\app\bootstrap.php.cache at line 564    
at Kernel ->handle (object(Request)) 
in D:\workspace9\roompot\web\app_dev.php at line 30    

And the entity:

Entity
<?php

namespace Samson\TRSBundle\Entity;

use Samson\AddressBookBundle\Entity\Person;
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 */
class Registrar
{
    /**
     * @ORM\Id
     * @ORM\OneToOne(targetEntity="Samson\AddressBookBundle\Entity\Person", cascade={"persist"})
     * @ORM\JoinColumn(nullable=false)
     */
    private $person;

    public function getId()
    {
        return $this->person->getId();
    }

    public function getPerson()
    {
        return $this->person;
    }

    public function setPerson($person)
    {
        $this->person = $person;
    }
}


 Comments   
Comment by Benjamin Eberlei [ 27/May/12 ]

This is a bug with the KnpPager. It doent handle this siutation and breaks the DQL => SQL AST. Our own pager throws another exception here, solving that within the scope of that ticket now.

Comment by Benjamin Eberlei [ 27/May/12 ]

Fixed in master.





[DDC-1686] Query/Expr/Join getAlias & getJoin Created: 06/Mar/12  Updated: 26/Mar/12  Resolved: 26/Mar/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Improvement Priority: Major
Reporter: Jelte Steijaert Assignee: Fabio B. Silva
Resolution: Fixed Votes: 0
Labels: None


 Description   

It would be helpfull if we could get the alias and the join properties, much like we can get the alias and from properties from Query/Expr/From



 Comments   
Comment by Fabio B. Silva [ 26/Mar/12 ]

Fixed by : https://github.com/doctrine/doctrine2/commit/2811d161bbb1b1e667cae5f0fb065018e82d6b25





[DDC-1800] Paginator results is wrong if your query use order by clause Created: 27/Apr/12  Updated: 09/Apr/13  Resolved: 29/Aug/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.2.2
Fix Version/s: 2.2.4, 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Marc Drolet Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None
Environment:

linux oracle



 Description   

NOTE: I didn't try this on other database, I'm using Oracle.

if my original fetchJoin query use an order by clause, the results is not keeping the provided order by clause and re-order them by id.

here is my generated query to get the distinct records that get generated:

SELECT distinct ID0
FROM
(
SELECT f0_.id AS ID0, f0_.deal_type_id AS DEAL_TYPE_ID1, f0_.title AS TITLE2, f0_.deal_date AS DEAL_DATE3, f0_.amount AS AMOUNT4,
f0_.abstract AS ABSTRACT5, f0_.created_date AS CREATED_DATE6, f0_.last_updated_date AS LAST_UPDATED_DATE7,
f0_.object_status_id AS OBJECT_STATUS_ID8, f0_.published_date AS PUBLISHED_DATE9, f0_.publishing_status_id AS PUBLISHING_STATUS_ID10,
f1_.id AS ID11, f1_.role_id AS ROLE_ID12, f1_.role_type_id AS ROLE_TYPE_ID13, f2_.id AS ID14, f3_.id AS ID15, f4_.id AS ID16, f5_.id AS ID17,
c6_.id AS ID18, d7_.id AS ID19
FROM fo_deal f0_
INNER JOIN fo_deal_role f1_ ON f0_.id = f1_.deal_id
INNER JOIN fo_people f2_ ON f1_.people_id = f2_.id
INNER JOIN fo_property_deal f3_ ON f0_.id = f3_.deal_id
INNER JOIN fo_property f4_ ON f3_.property_id = f4_.id
LEFT JOIN fo_property_asset f5_ ON f4_.id = f5_.property_id
LEFT JOIN co_asset c6_ ON f5_.asset_id = c6_.id
LEFT JOIN ds_record d7_ ON c6_.ds_id = d7_.id
WHERE f1_.people_id = 2
AND f0_.object_status_id <> 3
AND f0_.publishing_status_id = 2
ORDER BY f0_.deal_date DESC, f0_.published_date DESC
)

running this query I get the id 30, 44 when the inner query return 44, 30

here is the query that should get generated to take care of the order by clause:
SELECT distinct ID0, rownum+
FROM
(
SELECT f0_.id AS ID0, f0_.deal_type_id AS DEAL_TYPE_ID1, f0_.title AS TITLE2, f0_.deal_date AS DEAL_DATE3, f0_.amount AS AMOUNT4,
f0_.abstract AS ABSTRACT5, f0_.created_date AS CREATED_DATE6, f0_.last_updated_date AS LAST_UPDATED_DATE7,
f0_.object_status_id AS OBJECT_STATUS_ID8, f0_.published_date AS PUBLISHED_DATE9, f0_.publishing_status_id AS PUBLISHING_STATUS_ID10,
f1_.id AS ID11, f1_.role_id AS ROLE_ID12, f1_.role_type_id AS ROLE_TYPE_ID13, f2_.id AS ID14, f3_.id AS ID15, f4_.id AS ID16, f5_.id AS ID17,
c6_.id AS ID18, d7_.id AS ID19
FROM fo_deal f0_
INNER JOIN fo_deal_role f1_ ON f0_.id = f1_.deal_id
INNER JOIN fo_people f2_ ON f1_.people_id = f2_.id
INNER JOIN fo_property_deal f3_ ON f0_.id = f3_.deal_id
INNER JOIN fo_property f4_ ON f3_.property_id = f4_.id
LEFT JOIN fo_property_asset f5_ ON f4_.id = f5_.property_id
LEFT JOIN co_asset c6_ ON f5_.asset_id = c6_.id
LEFT JOIN ds_record d7_ ON c6_.ds_id = d7_.id
WHERE f1_.people_id = 2
AND f0_.object_status_id <> 3
AND f0_.publishing_status_id = 2
ORDER BY f0_.deal_date DESC, f0_.published_date DESC
) ORDER BY rownum ASC

To fix this on the Paginator code:

file: ORM/Tools/Pagination/LimitSubqueryOutputWalker.php
method: walkSelectStatement

change:
$sql = sprintf('SELECT b.*, rownum as rn FROM (SELECT DISTINCT %s FROM (%s)) b', // AS _dctrn_result',
implode(', ', $sqlIdentifier), $sql);

for:
$sql = sprintf('SELECT b.*, rownum as rn FROM (SELECT DISTINCT %s, numrow FROM (%s) ORDER BY numrow ASC) b', // AS _dctrn_result',
implode(', ', $sqlIdentifier), $sql);



 Comments   
Comment by Marc Drolet [ 14/May/12 ]

rownum instead of numrow. sorry.

$sql = sprintf('SELECT b.*, rownum as rn FROM (SELECT DISTINCT %s, rownum FROM (%s) ORDER BY rownum ASC) b',
implode(', ', $sqlIdentifier), $sql);

Comment by Benjamin Eberlei [ 07/Jul/12 ]

Doctrine 2.2.2 doesnt have the LimitSubqueryoutputWalker and Doctrine 2.3-dev does not have the line in the code. Can you make a more explicit statement of where the change is necessary?

Comment by Marc Drolet [ 09/Jul/12 ]

It's in the Pagination of version 2.2.2. ORM/Tools/Pagination/LimitSubqueryOutputWalker.php

Comment by Benjamin Eberlei [ 09/Jul/12 ]

This is the 2.2 branch, https://github.com/doctrine/doctrine2/tree/2.2/lib/Doctrine/ORM/Tools/Pagination and https://github.com/doctrine/doctrine2/tree/2.2.2/lib/Doctrine/ORM/Tools/Pagination is the 2.2.2 tag.

no LimitSubqueryOutputWalker.php in there.

Comment by Benjamin Eberlei [ 29/Aug/12 ]

Fixed

Comment by Raymond Kolbe [ 09/Apr/13 ]

This issue is popping it's head up again!

Benjamin, your tests don't test for the ordering problem unless those tests are happening somewhere else?

https://github.com/doctrine/doctrine2/commit/f55b5411c8b1f75bf2b5cf5ffe4bc50034fb91cb

I am performing a query as complex as Marc's and I experience the same exact issue. I have checked out today's latest master branch as well as the 2.3 tag with no change.

Please advise.

Comment by Raymond Kolbe [ 09/Apr/13 ]

I have a PR in https://github.com/doctrine/doctrine2/pull/645





[DDC-657] DateTime objects casted to string in query results Created: 27/Jun/10  Updated: 14/Jan/12  Resolved: 14/Jan/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: New Feature Priority: Major
Reporter: Tomasz Jędrzejewski Assignee: Fabio B. Silva
Resolution: Fixed Votes: 1
Labels: None
Environment:

Linux, PostgreSQL 8.4



 Description   

As we read in the documentation, 'datetime' fields are casted by Doctrine to PHP DateTime class objects. However, when we want to get only certain fields from a table using DQL, Doctrine casts the datetime value to ordinary string. Consider the following example:

Column definition
/**
 * @var DateTime $active
 *
 * @Column(name="registered", type="datetime")
 */
private $registered;
Query
var_dump($em->createQuery('SELECT u.id, u.registered FROM Entities\\User u')->getResult());

Expected result:

  • The returned row contains DateTime object for 'registered' column.

Actual result:

  • The returned row contains string for 'registered' column.

If this is an intended feature, first of all, it should be clearly pointed in the documentation that Doctrine types do not apply in such situations, and secondly, I think it is a very bad practice. I use Doctrine and tell him I have a datetime field in order to get Datetime objects automatically, not to deal with manual conversions.



 Comments   
Comment by Benjamin Eberlei [ 27/Jun/10 ]

oh wait, i am just now looking at your query, you are retrieving the values as scalar fields, that is something totally different. Let me check the code on this issue.

Comment by Tomasz Jędrzejewski [ 27/Jun/10 ]

ORM - the newest one from Git. I couldn't find any matching version in the issue form, so I selected nothing.
DBAL - the version that currently works with ORM. I've already noticed that DBAL-master does not work with the newest ORM .

Comment by Benjamin Eberlei [ 27/Jun/10 ]

Ok the problem is that currently scalar values retrieved from a DQL query are not converted to their PHP value. This affects scalar values only, if you rewrite the query to:

SELECT u FROM Entities\User u

you will get the Entities\User class with a DateTime instance in the "registered" variable.

Comment by Tomasz Jędrzejewski [ 28/Jun/10 ]

So far, I simply added a manual conversion that checks if the object was returned or not, so it will still work once the bug is fixed. In my case, sometimes I prefer to retrieve certain columns only, because the entire row can be quite big.

Comment by Benjamin Eberlei [ 01/Jul/10 ]

I think we should really fix this using an additional bit of information on the ResultSetMapping to hint the hydrators which type a scalar value is, if its an entity field, otherwise do nothing in conversion.

Array or Object fields, or even complex objects and serialization structs are pretty useless otherewise

Comment by Roman S. Borschel [ 07/Aug/10 ]

Scheduled for 2.1 for now.

Comment by Benjamin Eberlei [ 15/Sep/10 ]

Convert to feature (from bug)

Comment by Jan Volf [ 24/May/11 ]

I'm observing this problem on ORM 2.0.3 package with MySQL database and I would really expect this conversion to be implicit.
The Docs (12.7.1. Query Result Formats) says:

Query#getArrayResult(): Retrieves an array graph (a nested array) that is largely interchangeable with the object graph generated by Query#getResult() for read-only purposes.

But it is not interchangeable at all.

Anyway: It can potentially be an issue when dealing with timezones as the as it exposes the date in it's original format stored in DB, eventually without timezone on most DB engines. To interpret the such date the same way as Doctrine when hydrating to Object, one would need to know what timezone uses doctrine to interpret the DB timestamps without timezone.

Comment by Guilherme Blanco [ 13/Jan/12 ]

We have a nearly done PR for this issue: https://github.com/doctrine/doctrine2/pull/251
As soon as Fabio changes the pointed optimizations, this issue will be closed.

Comment by Fabio B. Silva [ 14/Jan/12 ]

Fixed since this commit : https://github.com/doctrine/doctrine2/commit/ea14bcff4a2a78bf774e8847b6645dca112f9757





[DDC-1677] [GH-295] by brikou: According to "Doctrine's implicit CS" and "Symfony's implicit CS" an emp... Created: 02/Mar/12  Updated: 01/Sep/13  Resolved: 03/Mar/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of

{username}

:

Url: https://github.com/doctrine/doctrine2/pull/295

Message:

...ty line added to the end of the file



 Comments   
Comment by Benjamin Eberlei [ 03/Mar/12 ]

fixed

Comment by Doctrine Bot [ 01/Sep/13 ]

A related Github Pull-Request [GH-295] was closed:
https://github.com/doctrine/common/pull/295





[DDC-1865] [GH-368] Join poc Created: 10/Jun/12  Updated: 05/Sep/13  Resolved: 22/Jun/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of guilhermeblanco:

Url: https://github.com/doctrine/doctrine2/pull/368

Message:



 Comments   
Comment by Benjamin Eberlei [ 18/Jun/12 ]

A related Github Pull-Request [GH-368] was closed
https://github.com/doctrine/doctrine2/pull/368

Comment by Guilherme Blanco [ 22/Jun/12 ]

PR was merged.

Comment by Doctrine Bot [ 05/Sep/13 ]

A related Github Pull-Request [GH-368] was closed:
https://github.com/doctrine/dbal/pull/368





[DDC-1679] [GH-296] by brikou: According to "Doctrine's implicit CS" and "Symfony's implicit CS" an emp... Created: 04/Mar/12  Updated: 11/Sep/13  Resolved: 05/Mar/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of brikou:

Url: https://github.com/doctrine/doctrine2/pull/296

Message:

...ty line added to the end of the file (...same tweaks like the one pushed for the entity generator)



 Comments   
Comment by Guilherme Blanco [ 05/Mar/12 ]

Merged.

https://github.com/doctrine/doctrine2/commit/f1fe3607880b57dc51b5089e10ae8c949eeb77d2

Comment by Doctrine Bot [ 11/Sep/13 ]

A related Github Pull-Request [GH-296] was closed:
https://github.com/doctrine/common/pull/296





[DDC-1868] [GH-370] Some PHP-CS fixes Created: 11/Jun/12  Updated: 12/Sep/13  Resolved: 22/Jun/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of Ph3nol:

Url: https://github.com/doctrine/doctrine2/pull/370

Message:



 Comments   
Comment by Benjamin Eberlei [ 15/Jun/12 ]

A related Github Pull-Request [GH-370] was closed
https://github.com/doctrine/doctrine2/pull/370

Comment by Guilherme Blanco [ 22/Jun/12 ]

PR was merged.

Comment by Doctrine Bot [ 12/Sep/13 ]

A related Github Pull-Request [GH-370] was closed:
https://github.com/doctrine/dbal/pull/370





[DDC-1870] [GH-372] [DDC-1845] QuoteStrategy Created: 12/Jun/12  Updated: 15/Sep/13  Resolved: 04/Jul/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of FabioBatSilva:

Url: https://github.com/doctrine/doctrine2/pull/372

Message:

      1. QuoteStrategy

http://www.doctrine-project.org/jira/browse/DDC-1845

This patch fix some quote problems using a default quote strategy and allows users find solutions themselves for weird quote cases.

This DBAL PR shoud be merged to fix sqlite tests in : https://github.com/doctrine/dbal/pull/158

There is a lote of new method calls, the performance tests in sqlite are the following :

        1. My branch :
          ```
          . testSimpleQueryScalarHydrationPerformance10000Rows - 0.37292098999023 seconds
          . testSimpleQueryArrayHydrationPerformance10000Rows - 0.50411009788513 seconds
          . testMixedQueryFetchJoinArrayHydrationPerformance10000Rows - 1.1323919296265 seconds
          . testSimpleQueryPartialObjectHydrationPerformance10000Rows - 1.0243051052094 seconds
          . testSimpleQueryFullObjectHydrationPerformance10000Rows - 4.1673181056976 seconds
          . testMixedQueryFetchJoinPartialObjectHydrationPerformance2000Rows - 0.40403699874878 seconds
          . testMixedQueryFetchJoinFullObjectHydrationPerformance2000Rows - 0.873291015625 seconds
          . 99 CompanyContract: 0.023395
          . 99 CompanyContract: 0.019528
          . Memory usage before: 111715.53125 KB
          . Memory usage after: 110282.875 KB
          . Inserted 10000 objects in 5.5240259170532 seconds
          . 100 CmsArticle findAll(): 0.018410
          . 100 CmsArticle findAll(): 0.014157
          . 100 CmsArticle find(): 0.043304
          . 100 CmsArticle find(): 0.041451
          . 100 CmsGroup: 0.009315
          . 100 CmsGroup: 0.009239
          . 100 CmsUser: 0.024051
          . 100 CmsUser: 0.023655
          . Compute ChangeSet 100 objects in 0.040482997894287 seconds

. Time: 19 seconds, Memory: 261.50Mb

```

        1. Doctrine Master :
          ```
          . testSimpleQueryScalarHydrationPerformance10000Rows - 0.37668490409851 seconds
          . testSimpleQueryArrayHydrationPerformance10000Rows - 0.5009880065918 seconds
          . testMixedQueryFetchJoinArrayHydrationPerformance10000Rows - 1.131824016571 seconds
          . testSimpleQueryPartialObjectHydrationPerformance10000Rows - 1.037791967392 seconds
          . testSimpleQueryFullObjectHydrationPerformance10000Rows - 4.1992859840393 seconds
          . testMixedQueryFetchJoinPartialObjectHydrationPerformance2000Rows - 0.41158103942871 seconds
          . testMixedQueryFetchJoinFullObjectHydrationPerformance2000Rows - 0.86575293540955 seconds
          . 99 CompanyContract: 0.023206
          . 99 CompanyContract: 0.020555
          . Inserted 10000 objects in 5.4995818138123 seconds
          . 100 CmsArticle findAll(): 0.018785
          . 100 CmsArticle findAll(): 0.014160
          . 100 CmsArticle find(): 0.042067
          . 100 CmsArticle find(): 0.041076
          . 100 CmsGroup: 0.009478
          . 100 CmsGroup: 0.010591
          . 100 CmsUser: 0.023727
          . 100 CmsUser: 0.023073
          . Compute ChangeSet 100 objects in 0.040009021759033 seconds

. Time: 19 seconds, Memory: 260.50Mb
```



 Comments   
Comment by Benjamin Eberlei [ 25/Jun/12 ]

A related Github Pull-Request [GH-372] was closed
https://github.com/doctrine/doctrine2/pull/372

Comment by Doctrine Bot [ 15/Sep/13 ]

A related Github Pull-Request [GH-372] was closed:
https://github.com/doctrine/dbal/pull/372





[DDC-1687] [GH-298] by sandermarechal: Pagination using SQL walkers Created: 06/Mar/12  Updated: 16/Sep/13  Resolved: 12/Mar/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of sandermarechal:

Url: https://github.com/doctrine/doctrine2/pull/298

Message:

A CountSqlWalker and LimitSubquerySqlWalker have been implemented. By
default the Paginator will use these SQL walkers. When a query already
uses custom SQL walkers, the Paginator will fall back to the existing
TreeWalker implementations. Improvements:

  • Support for more complex DQL queries using named mixed results with
    GROUP BY and HAVING. For example:

SELECT g, u, COUNT(u.id) AS userCount
FROM Entity\Group g LEFT JOIN g.users u
GROUP BY g.id
HAVING userCount > 0

  • Support for entities with composite primary keys in the CountSqlWalker
    and LimitSubquerySqlWalker. Only the WhereInWalker still needs to be
    updated for full composite primary key support. But someone smarter
    than me needs to look at that and figure out how to build a WHERE IN
    query that can select rows based on multiple columns.


 Comments   
Comment by Benjamin Eberlei [ 12/Mar/12 ]

Merged for 2.3

Comment by Doctrine Bot [ 16/Sep/13 ]

A related Github Pull-Request [GH-298] was closed:
https://github.com/doctrine/common/pull/298





[DDC-1869] [GH-371] set permissions as expected by composer.phar update Created: 11/Jun/12  Updated: 16/Sep/13  Resolved: 22/Jun/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of robocoder:

Url: https://github.com/doctrine/doctrine2/pull/371

Message:

I'm guessing the executable permissions were removed from these files recently.

composer.json copies the following scripts (i.e., "bin": ["bin/doctrine", "bin/doctrine.php"], ) to the vendor/bin folder.

When running composer.phar update, and doctrine/orm is to be updated, composer fails because these two scripts have been chmod'd to be executable.



 Comments   
Comment by Benjamin Eberlei [ 15/Jun/12 ]

A related Github Pull-Request [GH-371] was closed
https://github.com/doctrine/doctrine2/pull/371

Comment by Guilherme Blanco [ 22/Jun/12 ]

PR was merged.

Comment by Doctrine Bot [ 16/Sep/13 ]

A related Github Pull-Request [GH-371] was closed:
https://github.com/doctrine/dbal/pull/371





[DDC-1689] [GH-299] by patrick-mcdougle: Fixed comment for createQuery to include the variable name. Created: 06/Mar/12  Updated: 20/Sep/13  Resolved: 11/Mar/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of patrick-mcdougle:

Url: https://github.com/doctrine/doctrine2/pull/299

Message:



 Comments   
Comment by Benjamin Eberlei [ 11/Mar/12 ]

Merged

Comment by Doctrine Bot [ 20/Sep/13 ]

A related Github Pull-Request [GH-299] was closed:
https://github.com/doctrine/common/pull/299





[DDC-1878] [GH-377] Fix the documentation link in the README Created: 18/Jun/12  Updated: 26/Sep/13  Resolved: 22/Jun/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of Dinduks:

Url: https://github.com/doctrine/doctrine2/pull/377

Message:



 Comments   
Comment by Benjamin Eberlei [ 18/Jun/12 ]

A related Github Pull-Request [GH-377] was closed
https://github.com/doctrine/doctrine2/pull/377

Comment by Guilherme Blanco [ 22/Jun/12 ]

PR was merged.

Comment by Doctrine Bot [ 26/Sep/13 ]

A related Github Pull-Request [GH-377] was closed:
https://github.com/doctrine/dbal/pull/377





[DDC-1881] [GH-379] Fix join-poc merge Created: 18/Jun/12  Updated: 26/Sep/13  Resolved: 22/Jun/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of FabioBatSilva:

Url: https://github.com/doctrine/doctrine2/pull/379

Message:



 Comments   
Comment by Benjamin Eberlei [ 18/Jun/12 ]

A related Github Pull-Request [GH-379] was closed
https://github.com/doctrine/doctrine2/pull/379

Comment by Guilherme Blanco [ 22/Jun/12 ]

Fixed

Comment by Doctrine Bot [ 26/Sep/13 ]

A related Github Pull-Request [GH-379] was closed:
https://github.com/doctrine/dbal/pull/379





[DDC-1876] [GH-375] Allow passing any callable instead of only closures Created: 16/Jun/12  Updated: 30/Sep/13  Resolved: 22/Jun/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of lstrojny:

Url: https://github.com/doctrine/doctrine2/pull/375

Message:

This patch allows passing any callable to transactional(), not just closures.



 Comments   
Comment by Benjamin Eberlei [ 18/Jun/12 ]

A related Github Pull-Request [GH-375] was closed
https://github.com/doctrine/doctrine2/pull/375

Comment by Guilherme Blanco [ 22/Jun/12 ]

PR was merged.

Comment by Doctrine Bot [ 30/Sep/13 ]

A related Github Pull-Request [GH-375] was closed:
https://github.com/doctrine/dbal/pull/375





[DDC-1897] [GH-384] [DDC-1885] Fix quotes in many to many persisters Created: 27/Jun/12  Updated: 01/Oct/13  Resolved: 04/Jul/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of FabioBatSilva:

Url: https://github.com/doctrine/doctrine2/pull/384

Message:

http://www.doctrine-project.org/jira/browse/DDC-1885



 Comments   
Comment by Benjamin Eberlei [ 04/Jul/12 ]

A related Github Pull-Request [GH-384] was closed
https://github.com/doctrine/doctrine2/pull/384

Comment by Doctrine Bot [ 01/Oct/13 ]

A related Github Pull-Request [GH-384] was closed:
https://github.com/doctrine/dbal/pull/384





[DDC-1807] [GH-344] Composer modify Created: 02/May/12  Updated: 04/Oct/13  Resolved: 22/May/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of Hounddog:

Url: https://github.com/doctrine/doctrine2/pull/344

Message:

Included Bin file into composer
Modified bin dependencies to inclue the Composer Autoload.php
Added Missing Symfony/Console Dependency



 Comments   
Comment by Doctrine Bot [ 04/Oct/13 ]

A related Github Pull-Request [GH-344] was closed:
https://github.com/doctrine/dbal/pull/344





[DDC-1877] [GH-376] De-deprecate transaction handling methods Created: 16/Jun/12  Updated: 07/Oct/13  Resolved: 04/Jul/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of lstrojny:

Url: https://github.com/doctrine/doctrine2/pull/376

Message:

As discussed with @beberlei over IRC, deprecating transaction handling methods make the API cleaner but testing of Entity Manager dependent components much messier. Also suggesting to use `$em->getConnection()->beginTransaction()` feels like a violation of the law of demeter.

Therefore this pull request would remove the deprecation warnings from `EntityManager::beginTransaction()`, `EntityManager::commit()`, `EntityManager::rollback()`.



 Comments   
Comment by Doctrine Bot [ 07/Oct/13 ]

A related Github Pull-Request [GH-376] was closed:
https://github.com/doctrine/dbal/pull/376





[DDC-1902] [GH-387] fixed typo in command help text Created: 02/Jul/12  Updated: 17/Oct/13  Resolved: 04/Jul/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of shieldo:

Url: https://github.com/doctrine/doctrine2/pull/387

Message:



 Comments   
Comment by Benjamin Eberlei [ 02/Jul/12 ]

A related Github Pull-Request [GH-387] was closed
https://github.com/doctrine/doctrine2/pull/387

Comment by Doctrine Bot [ 17/Oct/13 ]

A related Github Pull-Request [GH-387] was closed:
https://github.com/doctrine/dbal/pull/387





[DDC-1911] [GH-392] Replaced a shallow-copy with a deep-copy to avoid side effects. Created: 06/Jul/12  Updated: 22/Oct/13  Resolved: 08/Jul/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of egeloen:

Url: https://github.com/doctrine/doctrine2/pull/392

Message:

Hey!

I'm currently using Symfony 2.1 + Doctrine master branch + Pager fanta master branch.

I'm facing a very vicious issue.

The doctrine paginator is able to clone a query with his `cloneQuery` method. This method will only clone the query without this parameters & hints. The issue is the parameters is setted with the `setParameters` method which will only affect the ArrayCollection reference to the new query builder and so, shared the reference between the two queries.

This PR will make a deep-copy of the ArrayCollection instead of a simple shallow-copy.

I'm not sure if this fix is the best solution.

Let me know if you need more information.



 Comments   
Comment by Benjamin Eberlei [ 08/Jul/12 ]

A related Github Pull-Request [GH-392] was closed
https://github.com/doctrine/doctrine2/pull/392

Comment by Doctrine Bot [ 22/Oct/13 ]

A related Github Pull-Request [GH-392] was closed:
https://github.com/doctrine/dbal/pull/392





[DDC-1904] [GH-388] Added an empty line feed preceding the return statement Created: 03/Jul/12  Updated: 26/Oct/13  Resolved: 04/Jul/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of fixe:

Url: https://github.com/doctrine/doctrine2/pull/388

Message:



 Comments   
Comment by Benjamin Eberlei [ 03/Jul/12 ]

A related Github Pull-Request [GH-388] was closed
https://github.com/doctrine/doctrine2/pull/388

Comment by Doctrine Bot [ 26/Oct/13 ]

A related Github Pull-Request [GH-388] was closed:
https://github.com/doctrine/dbal/pull/388





[DDC-1917] [GH-397] Cleanup/removing deprecated metadata drivers Created: 10/Jul/12  Updated: 02/Nov/13  Resolved: 12/Jul/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of Ocramius:

Url: https://github.com/doctrine/doctrine2/pull/397

Message:

Removing deprecated drivers that are already available in Doctrine\Common.
This PR depends on doctrine/common#164 and is a BC Break. For now it fails since the referenced git submodule for Doctrine\Common points to a commit that isn't yet in the common repository.

[![Build Status](https://secure.travis-ci.org/Ocramius/doctrine2.png?branch=cleanup/removing-deprecated-metadata-drivers)](http://travis-ci.org/Ocramius/doctrine2)



 Comments   
Comment by Benjamin Eberlei [ 12/Jul/12 ]

A related Github Pull-Request [GH-397] was closed
https://github.com/doctrine/doctrine2/pull/397

Comment by Doctrine Bot [ 02/Nov/13 ]

A related Github Pull-Request [GH-397] was closed:
https://github.com/doctrine/dbal/pull/397





[DDC-1946] [GH-409] added failing test for refresh with eager fetching Created: 26/Jul/12  Updated: 12/Nov/13  Resolved: 29/Jul/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of schmittjoh:

Url: https://github.com/doctrine/doctrine2/pull/409

Message:

This is just a failing test case to demonstrate the problem.



 Comments   
Comment by Benjamin Eberlei [ 29/Jul/12 ]

A related Github Pull-Request [GH-409] was closed
https://github.com/doctrine/doctrine2/pull/409

Comment by Doctrine Bot [ 12/Nov/13 ]

A related Github Pull-Request [GH-409] was closed:
https://github.com/doctrine/dbal/pull/409





[DDC-1925] Bug in UnitOfWork and ManyToMany relations Created: 14/Jul/12  Updated: 13/Nov/13  Resolved: 29/Jul/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.1
Fix Version/s: 2.1.8, 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Andrew Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: None
Environment:

symfony2



 Description   

Lets say, I have entity Forum with ManyToMany relations with User.
I need to validate user changes and I use code like

$uow = $this->getDoctrine()>getEntityManager()>getUnitOfWork();
$uow->computeChangeSets();
$changeSet = $uow->getEntityChangeSet($forum);
if (.... bla-bla-bla....)

{ $em = $this->getDoctrine()->getEntityManager(); $em->persist($forum); $em->flush(); }

Unfortunately, whenever I try to change manyToMany relations - I got error
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '4-4' for key 'PRIMARY'

If I comment uow code - everything works just great.

It looks like bug in UnitOfWork implementation.

Let me know if you need more details from me.



 Comments   
Comment by Marco Pivetta [ 16/Jul/12 ]

What is the part you commented out? Also, in what context is your code executed?

Comment by Andrew [ 16/Jul/12 ]

I got error when $em->persist($forum); $em->flush(); executed.

I can create github repository with code, which reproduce this error, if you want.

Comment by Marco Pivetta [ 16/Jul/12 ]

Please do

Comment by Andrew [ 16/Jul/12 ]

that would be simple symfony2 application - will it work for you?

Comment by Marco Pivetta [ 16/Jul/12 ]

As long as the code is related to doctrine. Otherwise this issue is quite incomplete

Comment by Andrew [ 16/Jul/12 ]

Done, please check https://github.com/zhil/testDoctrine

In few words, when I add code like
$uow = $this->getDoctrine()>getEntityManager()>getUnitOfWork();
$uow->computeChangeSets();
$changeSet = $uow->getEntityChangeSet($product);

before $em->persist(); $em->flush();

I got fake MYSQL error

Thank in advance for your help

Comment by Andrew [ 19/Jul/12 ]

Just wonder - is it bug in doctrine2 or its problems somewhere else? (symfony2/my code/ etc.)

This is part of the live project - I need to fix it

Comment by Marco Pivetta [ 19/Jul/12 ]

I think it is related with the fact that you're using the `UnitOfWork` manually. You can probably try to fix the problem by moving your code to an event subscriber until this is fixed.

Comment by Andrew [ 19/Jul/12 ]

Well, I used UnitOfWork, because I need to know what was changed during object validation (for example, property status can be changed only in predefined cases etc.).

Ok, thanks for the suggestion - I will implement some temporary solution for this problem

Comment by Marco Pivetta [ 19/Jul/12 ]

I think I spotted where this happens, but I don't have a clear overview on the situation. Will try to work on this...

Comment by Andrew [ 19/Jul/12 ]

Thanks for the checking this issue.
I have already patched my application with ugly patch. Just in case solution will take some time and somebody else will need similar patch. I patched entity like

entity {
public $previousStatusBugfix = -1;
public function setStatus($status)

{ // check http://www.doctrine-project.org/jira/browse/DDC-1925?focusedCommentId=18344#comment-18344 // Ticket #651 $this->previousStatusBugfix = $this->status; $this->status = $status; }

}

and validator

if(($object->previousStatusBugfix != 1) && ($object>previousStatusBugfix != $object->getStatus()))

{ $changeSet = array("status"=>array(0=>$object->previousStatusBugfix, 1=>$object->getStatus())); }

Comment by Marco Pivetta [ 19/Jul/12 ]

I just wrote a couple of tests (attaching them to the issue shortly) and found out that on `>=2.2.x` your code runs perfectly.
The problem is on the `2.1.x` branch, and the commit that fixed the issue is https://github.com/doctrine/doctrine2/commit/4474d30 for DDC-1210

Now looking if it can be merged into `2.1.x` since it doesn't seem to cause any BC break.

Comment by Benjamin Eberlei [ 19/Jul/12 ]

A related Github Pull-Request [GH-402] was opened
https://github.com/doctrine/doctrine2/pull/402

Comment by Benjamin Eberlei [ 19/Jul/12 ]

A related Github Pull-Request [GH-403] was opened
https://github.com/doctrine/doctrine2/pull/403

Comment by Marco Pivetta [ 19/Jul/12 ]

Duplicate of DDC-1210

Comment by Benjamin Eberlei [ 23/Jul/12 ]

A related Github Pull-Request [GH-403] was closed
https://github.com/doctrine/doctrine2/pull/403

Comment by Benjamin Eberlei [ 29/Jul/12 ]

A related Github Pull-Request [GH-402] was closed
https://github.com/doctrine/doctrine2/pull/402

Comment by Doctrine Bot [ 12/Nov/13 ]

A related Github Pull-Request [GH-402] was closed:
https://github.com/doctrine/dbal/pull/402

Comment by Doctrine Bot [ 13/Nov/13 ]

A related Github Pull-Request [GH-403] was closed:
https://github.com/doctrine/dbal/pull/403





[DDC-1937] [GH-405] Add possibility to cache annotations wih APC Created: 21/Jul/12  Updated: 13/Nov/13  Resolved: 29/Jul/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.2.3, 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of zim32:

Url: https://github.com/doctrine/doctrine2/pull/405

Message:

APC has a bug - after apc_fetch is made, arrays loose their cursors. That is why is_numeric(key(...)) is not working



 Comments   
Comment by Benjamin Eberlei [ 29/Jul/12 ]

A related Github Pull-Request [GH-405] was closed
https://github.com/doctrine/doctrine2/pull/405

Comment by Doctrine Bot [ 13/Nov/13 ]

A related Github Pull-Request [GH-405] was closed:
https://github.com/doctrine/dbal/pull/405

Comment by Christophe Coevoet [ 13/Nov/13 ]

It looks like the doctrine Bot is doing crap when a PR is closed. It notifies all issues marked with the PR number, even when they are for a different project (and so a different repo with its own PR numbers).





[DDC-1951] [GH-411] Added the new DBAL 2.3 types in the EntityGenerator typehint map Created: 27/Jul/12  Updated: 14/Nov/13  Resolved: 29/Jul/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of stof:

Url: https://github.com/doctrine/doctrine2/pull/411

Message:

This fixes the generated typehint for these new types.

@beberlei please backport it in 2.3 too



 Comments   
Comment by Benjamin Eberlei [ 29/Jul/12 ]

A related Github Pull-Request [GH-411] was closed
https://github.com/doctrine/doctrine2/pull/411

Comment by Doctrine Bot [ 14/Nov/13 ]

A related Github Pull-Request [GH-411] was closed:
https://github.com/doctrine/dbal/pull/411





[DDC-1962] [GH-416] [DDC-1961] Fixed parameter type support in Parameter Created: 31/Jul/12  Updated: 15/Nov/13  Resolved: 31/Jul/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of Majkl578:

Url: https://github.com/doctrine/doctrine2/pull/416

Message:



 Comments   
Comment by Benjamin Eberlei [ 31/Jul/12 ]

A related Github Pull-Request [GH-416] was closed
https://github.com/doctrine/doctrine2/pull/416

Comment by Doctrine Bot [ 15/Nov/13 ]

A related Github Pull-Request [GH-416] was closed:
https://github.com/doctrine/dbal/pull/416





[DDC-1708] [GH-304] by jwage: Allow flushing of many entities by passing an array of entities. Created: 15/Mar/12  Updated: 19/Nov/13  Resolved: 23/May/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: New Feature Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of jwage:

Url: https://github.com/doctrine/doctrine2/pull/304

Message:



 Comments   
Comment by Benjamin Eberlei [ 22/Mar/12 ]

Implemented for 2.3

Comment by Guilherme Blanco [ 23/May/12 ]

According to GH, this issue is already fixed: https://github.com/doctrine/doctrine2/commit/3aba23ea35413189b8b2fd0f2221b9882e932653

Comment by Doctrine Bot [ 19/Nov/13 ]

A related Github Pull-Request [GH-304] was closed:
https://github.com/doctrine/common/pull/304





[DDC-1990] [GH-427] Fix ORMInvalidArgumentException factory methods with return instead of throw Created: 19/Aug/12  Updated: 24/Nov/13  Resolved: 29/Aug/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of chEbba:

Url: https://github.com/doctrine/doctrine2/pull/427

Message:

Exception factories should not throw exception but just return them



 Comments   
Comment by Benjamin Eberlei [ 29/Aug/12 ]

A related Github Pull-Request [GH-427] was closed
https://github.com/doctrine/doctrine2/pull/427

Comment by Doctrine Bot [ 24/Nov/13 ]

A related Github Pull-Request [GH-427] was closed:
https://github.com/doctrine/dbal/pull/427





[DDC-2027] [GH-443] Allow 'nullable' attribute to be used during XML export Created: 13/Sep/12  Updated: 12/Dec/13  Resolved: 17/Sep/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of cas87:

Url: https://github.com/doctrine/doctrine2/pull/443

Message:

Allows 'nullable' attribute to be used during XML export, something which already worked for me in YamlExport. This addition saved me a lot of time during development; one less difference to deal with between the YAML and XML approach.

Don't know why this was missing, maybe it's me who is missing something, so let me know



 Comments   
Comment by Benjamin Eberlei [ 13/Sep/12 ]

A related Github Pull-Request [GH-443] was closed
https://github.com/doctrine/doctrine2/pull/443

Comment by Doctrine Bot [ 12/Dec/13 ]

A related Github Pull-Request [GH-443] was closed:
https://github.com/doctrine/dbal/pull/443





[DDC-1873] [GH-373] Grammar fix for composer.json file Created: 12/Jun/12  Updated: 13/Dec/13  Resolved: 22/Jun/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of bschaeffer:

Url: https://github.com/doctrine/doctrine2/pull/373

Message:



 Comments   
Comment by Benjamin Eberlei [ 13/Jun/12 ]

A related Github Pull-Request [GH-373] was closed
https://github.com/doctrine/doctrine2/pull/373

Comment by Guilherme Blanco [ 22/Jun/12 ]

PR was merged.

Comment by Doctrine Bot [ 13/Dec/13 ]

A related Github Pull-Request [GH-373] was closed:
https://github.com/doctrine/dbal/pull/373





[DDC-2014] [GH-436] Comment fixes Created: 06/Sep/12  Updated: 13/Dec/13  Resolved: 17/Sep/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of Powerhamster:

Url: https://github.com/doctrine/doctrine2/pull/436

Message:

This will update method comments in UnitOfWork and fixes a typo in isCollectionScheduledForDeletion.
It also add a missing use statement in getQuotedIdentifierColumnNames of ClassMetadateInfo.



 Comments   
Comment by Doctrine Bot [ 13/Dec/13 ]

A related Github Pull-Request [GH-436] was closed:
https://github.com/doctrine/dbal/pull/436





[DDC-2005] [GH-433] DDC-2003 - DateTime conditions in Criteria objects result in errors Created: 31/Aug/12  Updated: 13/Dec/13  Resolved: 17/Sep/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of Josiah:

Url: https://github.com/doctrine/doctrine2/pull/433

Message:



 Comments   
Comment by Benjamin Eberlei [ 05/Sep/12 ]

A related Github Pull-Request [GH-433] was closed
https://github.com/doctrine/doctrine2/pull/433

Comment by Doctrine Bot [ 13/Dec/13 ]

A related Github Pull-Request [GH-433] was closed:
https://github.com/doctrine/dbal/pull/433





[DDC-1964] [GH-417] Remove unused use statement Created: 02/Aug/12  Updated: 18/Dec/13  Resolved: 14/Aug/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of jonathaningram:

Url: https://github.com/doctrine/doctrine2/pull/417

Message:



 Comments   
Comment by Benjamin Eberlei [ 02/Aug/12 ]

A related Github Pull-Request [GH-417] was closed
https://github.com/doctrine/doctrine2/pull/417

Comment by Doctrine Bot [ 18/Dec/13 ]

A related Github Pull-Request [GH-417] was closed:
https://github.com/doctrine/dbal/pull/417





[DDC-1982] [GH-424] Create the setCustomHydrationMode function Created: 14/Aug/12  Updated: 18/Dec/13  Resolved: 14/Aug/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Alexander
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of Mezzle:

Url: https://github.com/doctrine/doctrine2/pull/424

Message:

This allows multiple hydrators to be set at once, and also allows for
the customHydrationMode options to be set via DoctrineORMModule



 Comments   
Comment by Benjamin Eberlei [ 14/Aug/12 ]

A related Github Pull-Request [GH-424] was closed
https://github.com/doctrine/doctrine2/pull/424

Comment by Alexander [ 14/Aug/12 ]

PR was squashed and merged.

Comment by Doctrine Bot [ 18/Dec/13 ]

A related Github Pull-Request [GH-424] was closed:
https://github.com/doctrine/dbal/pull/424





[DDC-1949] [GH-410] [2.3] Use dHelperSet in cli-config.php Created: 26/Jul/12  Updated: 18/Dec/13  Resolved: 29/Jul/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Documentation Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of igorw:

Url: https://github.com/doctrine/doctrine2/pull/410

Message:



 Comments   
Comment by Benjamin Eberlei [ 29/Jul/12 ]

A related Github Pull-Request [GH-410] was closed
https://github.com/doctrine/doctrine2/pull/410

Comment by Doctrine Bot [ 18/Dec/13 ]

A related Github Pull-Request [GH-410] was closed:
https://github.com/doctrine/dbal/pull/410





[DDC-1726] [GH-310] [DDC-889] Mention parent class for debugging purposes. Created: 25/Mar/12  Updated: 19/Dec/13  Resolved: 30/Mar/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of FabioBatSilva:

Url: https://github.com/doctrine/doctrine2/pull/310

Message:

@beberlei I tried to use ClassMetadata#parentClasses but is not loaded at this point.



 Comments   
Comment by Benjamin Eberlei [ 26/Mar/12 ]

A related Github Pull-Request [GH-310] was synchronize
https://github.com/doctrine/doctrine2/pull/310

Comment by Benjamin Eberlei [ 26/Mar/12 ]

A related Github Pull-Request [GH-310] was synchronize
https://github.com/doctrine/doctrine2/pull/310

Comment by Benjamin Eberlei [ 26/Mar/12 ]

A related Github Pull-Request [GH-310] was synchronize
https://github.com/doctrine/doctrine2/pull/310

Comment by Benjamin Eberlei [ 29/Mar/12 ]

A related Github Pull-Request [GH-310] was synchronize
https://github.com/doctrine/doctrine2/pull/310

Comment by Benjamin Eberlei [ 29/Mar/12 ]

A related Github Pull-Request [GH-310] was synchronize
https://github.com/doctrine/doctrine2/pull/310

Comment by Benjamin Eberlei [ 30/Mar/12 ]

A related Github Pull-Request [GH-310] was closed
https://github.com/doctrine/doctrine2/pull/310

Comment by Doctrine Bot [ 19/Dec/13 ]

A related Github Pull-Request [GH-310] was closed:
https://github.com/doctrine/common/pull/310





[DDC-1808] [GH-345] Fixed DDC-1802 Created: 02/May/12  Updated: 19/Dec/13  Resolved: 04/May/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of hason:

Url: https://github.com/doctrine/doctrine2/pull/345

Message:



 Comments   
Comment by Benjamin Eberlei [ 04/May/12 ]

A related Github Pull-Request [GH-345] was closed
https://github.com/doctrine/doctrine2/pull/345

Comment by Doctrine Bot [ 19/Dec/13 ]

A related Github Pull-Request [GH-345] was closed:
https://github.com/doctrine/dbal/pull/345





[DDC-1735] [GH-312] Removed LOCK_EX for writing Proxy class file Created: 29/Mar/12  Updated: 19/Dec/13  Resolved: 05/Jul/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.2.3, 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of hason:

Url: https://github.com/doctrine/doctrine2/pull/312

Message:

LOCK_EX will not work on NFS and many other networked file systems.

Replaces #307



 Comments   
Comment by Benjamin Eberlei [ 29/Mar/12 ]

A related Github Pull-Request [GH-312] was synchronize
https://github.com/doctrine/doctrine2/pull/312

Comment by Benjamin Eberlei [ 30/Mar/12 ]

A related Github Pull-Request [GH-312] was synchronize
https://github.com/doctrine/doctrine2/pull/312

Comment by Benjamin Eberlei [ 30/Mar/12 ]

A related Github Pull-Request [GH-312] was synchronize
https://github.com/doctrine/doctrine2/pull/312

Comment by Benjamin Eberlei [ 01/Apr/12 ]

A related Github Pull-Request [GH-312] was synchronize
https://github.com/doctrine/doctrine2/pull/312

Comment by Benjamin Eberlei [ 04/Apr/12 ]

A related Github Pull-Request [GH-312] was synchronize
https://github.com/doctrine/doctrine2/pull/312

Comment by Benjamin Eberlei [ 06/Apr/12 ]

A related Github Pull-Request [GH-312] was synchronize
https://github.com/doctrine/doctrine2/pull/312

Comment by Benjamin Eberlei [ 07/Apr/12 ]

A related Github Pull-Request [GH-312] was synchronize
https://github.com/doctrine/doctrine2/pull/312

Comment by Benjamin Eberlei [ 05/Jul/12 ]

Changed to using temporary filename + rename

Comment by Doctrine Bot [ 19/Dec/13 ]

A related Github Pull-Request [GH-312] was closed:
https://github.com/doctrine/common/pull/312





[DDC-2015] [GH-437] Fixes PersistentCollection::matching() when collection is not initialize... Created: 07/Sep/12  Updated: 20/Dec/13  Resolved: 17/Sep/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of sroddy:

Url: https://github.com/doctrine/doctrine2/pull/437

Message:

...d and there are NEW entities in the collection.

If you have a PersistentCollection not already initialized and you add something to it and if you call matching() on it, that method doesn't return the elements you have just added even if they match the criteria.

This fixes the behaviour checking for any matching element that is NEW and merging it in the returned ArrayCollection.



 Comments   
Comment by Benjamin Eberlei [ 07/Sep/12 ]

A related Github Pull-Request [GH-437] was closed
https://github.com/doctrine/doctrine2/pull/437

Comment by Doctrine Bot [ 20/Dec/13 ]

A related Github Pull-Request [GH-437] was closed:
https://github.com/doctrine/dbal/pull/437





[DDC-1866] [GH-369] Show the advice only when relevant. Created: 10/Jun/12  Updated: 20/Dec/13  Resolved: 22/Jun/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of greg0ire:

Url: https://github.com/doctrine/doctrine2/pull/369

Message:

This is indeed a good advice, but people who
already have implemented __toString() might
get confused about it.



 Comments   
Comment by Benjamin Eberlei [ 18/Jun/12 ]

A related Github Pull-Request [GH-369] was closed
https://github.com/doctrine/doctrine2/pull/369

Comment by Guilherme Blanco [ 22/Jun/12 ]

PR was merged.

Comment by Doctrine Bot [ 20/Dec/13 ]

A related Github Pull-Request [GH-369] was closed:
https://github.com/doctrine/dbal/pull/369





[DDC-1561] GH-239: Fix $qb->expr() PHPDoc @return type. Created: 23/Dec/11  Updated: 20/Dec/13  Resolved: 28/Dec/11

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.1.6, 2.2-BETA2, 2.2, 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

Pull-Request was automatically synchronized: https://github.com/doctrine/doctrine2/pull/239

The autocompletion was missing so i was sad.

But hey, it's open source!



 Comments   
Comment by Benjamin Eberlei [ 28/Dec/11 ]

Fixed

Comment by Doctrine Bot [ 20/Dec/13 ]

A related Github Pull-Request [GH-239] was closed:
https://github.com/doctrine/dbal/pull/239





[DDC-1912] [GH-393] Updated the classmetadata factory for Common 2.3 Created: 06/Jul/12  Updated: 20/Dec/13  Resolved: 07/Jul/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of stof:

Url: https://github.com/doctrine/doctrine2/pull/393

Message:

This adds the new method introduced in doctrine/common#162



 Comments   
Comment by Benjamin Eberlei [ 07/Jul/12 ]

A related Github Pull-Request [GH-393] was closed
https://github.com/doctrine/doctrine2/pull/393

Comment by Doctrine Bot [ 20/Dec/13 ]

A related Github Pull-Request [GH-393] was closed:
https://github.com/doctrine/dbal/pull/393





[DDC-1855] [GH-363] Entities generator: constructor's template docblock Created: 06/Jun/12  Updated: 20/Dec/13  Resolved: 22/Jun/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of gajdaw:

Url: https://github.com/doctrine/doctrine2/pull/363

Message:

Missing constructor's docblock.



 Comments   
Comment by Benjamin Eberlei [ 15/Jun/12 ]

A related Github Pull-Request [GH-363] was closed
https://github.com/doctrine/doctrine2/pull/363

Comment by Guilherme Blanco [ 22/Jun/12 ]

PR was merged.

Comment by Doctrine Bot [ 20/Dec/13 ]

A related Github Pull-Request [GH-363] was closed:
https://github.com/doctrine/dbal/pull/363





[DDC-1798] [GH-342] Fix identifier generator strategy for composite identifier Created: 26/Apr/12  Updated: 20/Dec/13  Resolved: 27/May/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.2.3, 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of jeanmonod:

Url: https://github.com/doctrine/doctrine2/pull/342

Message:

When using the ConvertMappingCommand on a schema that contain a table with a composite key, we got the exception:

Single id is not allowed on composite primary key in entity CollectionFields

This can be fix by setting the identifier strategy to NONE for composite identifier fields



 Comments   
Comment by Benjamin Eberlei [ 27/May/12 ]

Fixed

Comment by Doctrine Bot [ 20/Dec/13 ]

A related Github Pull-Request [GH-342] was closed:
https://github.com/doctrine/dbal/pull/342





[DDC-1941] [GH-407] DDC-1939 - Removing references to non-existing AssociationMapping class Created: 24/Jul/12  Updated: 20/Dec/13  Resolved: 29/Jul/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.2.3, 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of Ocramius:

Url: https://github.com/doctrine/doctrine2/pull/407

Message:

This fixes DDC-1939, which is caused by an overlooked usage of `Doctrine\ORM\Mapping\AssociationMapping`, which was removed.



 Comments   
Comment by Benjamin Eberlei [ 29/Jul/12 ]

A related Github Pull-Request [GH-407] was closed
https://github.com/doctrine/doctrine2/pull/407

Comment by Benjamin Eberlei [ 29/Jul/12 ]

Merged this PR

Comment by Doctrine Bot [ 20/Dec/13 ]

A related Github Pull-Request [GH-407] was closed:
https://github.com/doctrine/dbal/pull/407





[DDC-1883] [GH-380] remove svn markers Created: 19/Jun/12  Updated: 20/Dec/13  Resolved: 22/Jun/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of FabioBatSilva:

Url: https://github.com/doctrine/doctrine2/pull/380

Message:



 Comments   
Comment by Benjamin Eberlei [ 19/Jun/12 ]

A related Github Pull-Request [GH-380] was closed
https://github.com/doctrine/doctrine2/pull/380

Comment by Guilherme Blanco [ 22/Jun/12 ]

PR was merged.

Comment by Doctrine Bot [ 20/Dec/13 ]

A related Github Pull-Request [GH-380] was closed:
https://github.com/doctrine/dbal/pull/380





[DDC-1862] [GH-365] DDC-1860 - Composer arbitrary for CLI and composer/autoload.php in different paths Created: 09/Jun/12  Updated: 21/Dec/13  Resolved: 22/Jun/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of Ocramius:

Url: https://github.com/doctrine/doctrine2/pull/365

Message:

DDC-1860 - Composer became a requirement to run CLI some time ago. This patch:

1. Makes composer optional if the user defines his own autoloaders in `cli-config.php`
2. Makes the CLI look for `vendor/composer.php` in various parent paths of the `bin` directory.



 Comments   
Comment by Benjamin Eberlei [ 09/Jun/12 ]

A related Github Pull-Request [GH-365] was closed
https://github.com/doctrine/doctrine2/pull/365

Comment by Guilherme Blanco [ 22/Jun/12 ]

PR was merged.

Comment by Doctrine Bot [ 08/Sep/13 ]

A related Github Pull-Request [GH-365] was closed:
https://github.com/doctrine/dbal/pull/365

Comment by Doctrine Bot [ 21/Dec/13 ]

A related Github Pull-Request [GH-365] was closed:
https://github.com/doctrine/dbal/pull/365





[DDC-1854] [GH-362] Correct some mistakes (tabs & trailing spaces) Created: 05/Jun/12  Updated: 22/Dec/13  Resolved: 22/Jun/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of odolbeau:

Url: https://github.com/doctrine/doctrine2/pull/362

Message:



 Comments   
Comment by Benjamin Eberlei [ 15/Jun/12 ]

A related Github Pull-Request [GH-362] was closed
https://github.com/doctrine/doctrine2/pull/362

Comment by Guilherme Blanco [ 22/Jun/12 ]

PR was merged.

Comment by Doctrine Bot [ 22/Dec/13 ]

A related Github Pull-Request [GH-362] was closed:
https://github.com/doctrine/dbal/pull/362





[DDC-2026] [GH-442] Remove unused code Created: 13/Sep/12  Updated: 29/Dec/13  Resolved: 17/Sep/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of FabioBatSilva:

Url: https://github.com/doctrine/doctrine2/pull/442

Message:

This patch remove some unused code.
Sorry, I added this code by mistake, it was part of a old implementation.

@beberlei please backported it to 2.3



 Comments   
Comment by Doctrine Bot [ 29/Dec/13 ]

A related Github Pull-Request [GH-442] was closed:
https://github.com/doctrine/dbal/pull/442





[DDC-1550] GH-234: Fix QueryTest#testJoinQueries order Created: 20/Dec/11  Updated: 03/Feb/14  Resolved: 28/Dec/11

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

Pull-Request was automatically synchronized: https://github.com/doctrine/doctrine2/pull/234

I don't know why, but sometimes postgres change the order by column default.

http://travis-ci.org/#!/doctrine/doctrine2/jobs/428335

I just add ORDER BY, I think that fix the problem.



 Comments   
Comment by Doctrine Bot [ 03/Feb/14 ]

A related Github Pull-Request [GH-234] was closed:
https://github.com/doctrine/common/pull/234





[DDC-1572] LIKE expressions doesn't allow the matching pattern to be a string function Created: 29/Dec/11  Updated: 11/Feb/14  Resolved: 31/Dec/11

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: DQL
Affects Version/s: Git Master
Fix Version/s: 2.3
Security Level: All

Type: Improvement Priority: Major
Reporter: Miloslav "adrive" Kmet Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

Like expressions doesn't allow the matching apttern to be a function returning string like LOWER(column) LIKE LOWER(:param)

Query parsers is returning exception like this:

[Syntax Error] line 0, col 82: Error: Expected Doctrine\ORM\Query\Lexer::T_STRING, got 'LOWER'

It is not possible to construct queries like this:

SELECT u.name FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE UPPER(u.name) LIKE UPPER(:str)

I'll create a pull request on github for this issue.



 Comments   
Comment by Benjamin Eberlei [ 29/Dec/11 ]

Assigned to Guilherme

Comment by Benjamin Eberlei [ 29/Dec/11 ]

This issue is referenced in Github Pull-Request GH-245
https://github.com/doctrine/doctrine2/pull/245

Comment by Benjamin Eberlei [ 31/Dec/11 ]

This was merged

Comment by Doctrine Bot [ 11/Feb/14 ]

A related Github Pull-Request [GH-245] was closed:
https://github.com/doctrine/dbal/pull/245





[DDC-1748] [GH-317] Fix DDC-1694 Created: 01/Apr/12  Updated: 24/Feb/14  Resolved: 05/May/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of FabioBatSilva:

Url: https://github.com/doctrine/doctrine2/pull/317

Message:

http://www.doctrine-project.org/jira/browse/DDC-1694

if I understand right
Probably this code will be replaced by Benjamin's Code Generator.

Any way, for now I think this is a valid issue..



 Comments   
Comment by Benjamin Eberlei [ 01/Apr/12 ]

A related Github Pull-Request [GH-317] was synchronize
https://github.com/doctrine/doctrine2/pull/317

Comment by Benjamin Eberlei [ 01/Apr/12 ]

A related Github Pull-Request [GH-317] was synchronize
https://github.com/doctrine/doctrine2/pull/317

Comment by Benjamin Eberlei [ 04/Apr/12 ]

A related Github Pull-Request [GH-317] was synchronize
https://github.com/doctrine/doctrine2/pull/317

Comment by Benjamin Eberlei [ 06/Apr/12 ]

A related Github Pull-Request [GH-317] was synchronize
https://github.com/doctrine/doctrine2/pull/317

Comment by Benjamin Eberlei [ 07/Apr/12 ]

A related Github Pull-Request [GH-317] was synchronize
https://github.com/doctrine/doctrine2/pull/317

Comment by Doctrine Bot [ 24/Feb/14 ]

A related Github Pull-Request [GH-317] was closed:
https://github.com/doctrine/common/pull/317





[DDC-937] doctrine-mapping.xsd sequence relation-entities Created: 15/Dec/10  Updated: 23/Jun/12  Resolved: 23/Jun/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: Mapping Drivers
Affects Version/s: Git Master
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Minor
Reporter: Leon van der Ree Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

I noticed some problems with
the doctrine-mapping.xsd (which apparently is not used to validate the
mapping, but only provided to support code completion in your xml-
editor)

The order in which you define the elements like cascade and join-
column(s) for the relation-entities is currently important since it is
a sequence, but is this really desired? Why force this order? defining
cascade before join-column would make perfect sense as well, doesn't
it.



 Comments   
Comment by Guilherme Blanco [ 04/Oct/11 ]

Is this issue still valid in the latest Doctrine (trunk)? It doesn't seem to be.

Comment by Guilherme Blanco [ 23/Jun/12 ]

No reply from user and issue seems to be fixed already in master





[DDC-1470] Bad discrimator value give imprecise error exception Created: 04/Nov/11  Updated: 16/Mar/12  Resolved: 16/Mar/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.1
Fix Version/s: 2.3

Type: Improvement Priority: Minor
Reporter: Francois Mazerolle Assignee: Fabio B. Silva
Resolution: Fixed Votes: 0
Labels: None


 Description   

When you define a wrong discriminator field in the mapping configuration, doctrine will return the following ErrorException when trying to get an instance of the object:

ErrorException: Notice: Undefined index: in /Users/fmaz/Site/vendor/doctrine/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php line 92

This is not precise enough, an error giving hint on the mapping configuration that is concerned, and on the bad field should be given.

Hope this will help improving the "userfriendlyness"



 Comments   
Comment by Guilherme Blanco [ 16/Mar/12 ]

Fixed in https://github.com/doctrine/doctrine2/commit/6f3ef148a95c6e598f9b16848c6a33b3d7a39077





[DDC-1977] Undefined index in ParameterTypeInferer Created: 10/Aug/12  Updated: 29/Aug/12  Resolved: 25/Aug/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.2.3
Fix Version/s: 2.2.4, 2.3
Security Level: All

Type: Bug Priority: Minor
Reporter: Matt Button Assignee: Fabio B. Silva
Resolution: Fixed Votes: 0
Labels: None
Environment:

PHP 5.3.6-13ubuntu3.8 with Suhosin-Patch (cli) (built: Jun 13 2012 17:19:54)

{ "package": "doctrine/common", "version": "2.2.2" }

,

{ "package": "doctrine/dbal", "version": "2.2.x-dev", "source-reference": "b961a3fce6bf220f1dca47d7d747b9074bea4730", "commit-date": "1341779435" }

,

{ "package": "doctrine/doctrine-bundle", "version": "dev-master", "source-reference": "62134e6a8dd3f330131ee6a970f0cee1d7760c1d", "commit-date": "1343203511" }

,

{ "package": "doctrine/orm", "version": "2.2.x-dev", "source-reference": "5d2a3bcb3b467f41ee58575764f3ba84937f76e4", "commit-date": "1341676080" }

,



 Description   

Trying to bind an empty array as a parameter to a raw SQL query results in an undefined index error on line 59.

https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Query/ParameterTypeInferer.php#L59



 Comments   
Comment by Matt Button [ 10/Aug/12 ]

One way to work around this is to specify the type of the array as the third parameter to addParameter

Comment by Fabio B. Silva [ 25/Aug/12 ]

Fixed by : https://github.com/doctrine/doctrine2/commit/ece6a005bcecc4a9e4a154d9379cfbe141370415





[DDC-1663] Implement @NamedNativeQuery and @SqlResultSetMapping Created: 21/Feb/12  Updated: 18/Apr/12  Resolved: 18/Apr/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: Mapping Drivers
Affects Version/s: Git Master
Fix Version/s: 2.3
Security Level: All

Type: New Feature Priority: Minor
Reporter: Fabio B. Silva Assignee: Fabio B. Silva
Resolution: Fixed Votes: 0
Labels: None


 Description   

You may also express queries in the native SQL dialect of your database.
This is useful if you want to utilize database specific features.

  1. The NamedNativeQuery is used to specify a native SQL named query.
  2. The SqlResultSetMapping is used to specify the mapping of the result of a native SQL query.
  3. The NamedNativeQuery and SqlResultSetMapping annotations/xml/yml can be applied to an entity or mapped superclass.


 Comments   
Comment by Guilherme Blanco [ 22/Feb/12 ]

I'm fine with it. I didn't include it in the beginning (when I was creating the NamedQuery support) because of lack of time.
Also, we should focus on what Hibernate does and implement the required modifications for our scenario.

A complete solution would be something like:

/**
 * @Entity
 *
 * @NamedNativeQueries({
 *     @NamedNativeQuery(
 *         name="sample-query",
 *         query="SELECT ... FROM ... WHERE ...",
 *         resultSetMapping="sample-mapping"
 *     )
 * })
 *
 * @ResultSetMappings({
 *     @ResultSetMapping(
 *         name="sample-mapping",
 *         entities={
 *             @EntityResult(
 *                 name="App\Entity\MyEntity",
 *                 fields={
 *                     @FieldResult(name="id", column="entity_id"),
 *                     ...
 *                 }
 *             ),
 *             ...
 *         }
 *     ),
 *     ...
 * })
 */
class MyEntity
{
    // ...
}
Comment by Fabio B. Silva [ 18/Apr/12 ]

Solved by : https://github.com/doctrine/doctrine2/commit/bad811df6a07992405d2f59968d39e1670cad154





[DDC-1603] Unique key name isn't correctly set Created: 16/Jan/12  Updated: 22/Jan/12  Resolved: 17/Jan/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: Tools
Affects Version/s: 2.2-BETA2
Fix Version/s: 2.1.6, 2.2.0-RC1, 2.2, 2.3

Type: Bug Priority: Minor
Reporter: Thomas Tourlourat - Armetiz Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

Example :

<unique-constraints>
<unique-constraint columns="permalink" />
<unique-constraint columns="code" />
</unique-constraints>

This will create :
CREATE UNIQUE INDEX UNIQ_6C3BF144F286BC32 ON shows (permalink);
CREATE UNIQUE INDEX 1 ON shows (code);

instead of :
CREATE UNIQUE INDEX UNIQ_6C3BF144F286BC32 ON shows (permalink);
CREATE UNIQUE INDEX UNIQ_6C3BF14477153098 ON shows (code);

The problem comme from SchemaTool, and the first key is a valid result because of "==" instead of "===" inside Table.php.

I have create a PR on Github.



 Comments   
Comment by Thomas Tourlourat - Armetiz [ 16/Jan/12 ]

Here the PR for the ORM SchemaTool : https://github.com/doctrine/doctrine2/pull/261
Here the PR for the DBAL Table : https://github.com/doctrine/dbal/pull/94

Comment by Guilherme Blanco [ 17/Jan/12 ]

Merged https://github.com/doctrine/doctrine2/commit/2bb511584e5d37ddad6c669a19d8e6b4a20f7b2b

Comment by Benjamin Eberlei [ 21/Jan/12 ]

DBAL merged back into 2.2 and 2.1.x

Comment by Benjamin Eberlei [ 21/Jan/12 ]

and Merged into 2.2 and 2.1.x ORM





[DDC-1579] MappedSuperClass and inheritance problem with console generate:entities command Created: 05/Jan/12  Updated: 10/Dec/12  Resolved: 09/Jan/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: Tools
Affects Version/s: 2.1.5
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Minor
Reporter: Sergio Moya Assignee: Benjamin Eberlei
Resolution: Duplicate Votes: 0
Labels: None
Environment:

Debian 6.0.3 - Linux 2.6.32-5-amd64

Symfony2 2.0.8 + Doctrine2 2.1.5


Issue Links:
Dependency
depends on DDC-1590 Fix Inheritance in Code-Generation Open

 Description   

I have two classes.

One extends from another. I'm using the annotation @MappedSuperclass
and operates correctly, but when he did the entities generation
through the command console, doctrine adds the property and the
methods of the "father" class in the subclass.

This is a bug of the command console?

Really you should not copy them if you do not extend them. When you
run the update of the database schema, i must delete these fields and
methods added to obtain the desired result.

What happens?

Im usign Symfony 2.

Thanks!!!!

Code:

Father class:

/********************************************************************

/**

  • @ORM\MappedSuperclass
    */
    abstract class ConfigBase
    {

/**

  • @ORM\Column(name="enabled", type="boolean")
    */
    protected $enabled;

/**

  • Set enabled
    *
  • @param boolean $enabled
    */
    public function setEnabled($enabled) { $this->enabled = $enabled; }

    /**
    * Get enabled
    *
    * @return boolean
    */
    public function getEnabled()
    { return $this->enabled; }

    }

    /********************************************************************

    SubClass

    /********************************************************************

    /**
    * @ORM\Entity
    *
    */
    class UserConfig extends ConfigBase
    {
    /**
    * @var integer $id
    *
    * @ORM\Column(name="id", type="integer")
    * @ORM\Id
    * @ORM\GeneratedValue(strategy="AUTO")
    */
    protected $id;

    /**
    * Get id
    *
    * @return integer
    */
    public function getId()
    { return $this->id; }

    /************************************************/
    /* Auto generated and non desired values */
    /************************************************/
    /**
    * @var boolean $enabled
    */
    private $enabled;

    /**
    * Set enabled
    *
    * @param boolean $enabled
    */
    public function setEnabled($enabled)
    { $this->enabled = $enabled; }

/**

  • Get enabled
    *
  • @return boolean
    */
    public function getEnabled() { return $this->enabled; }


 Comments   
Comment by Benjamin Eberlei [ 09/Jan/12 ]

It is a known problem that will be fixed in 2.3 hopefully.

Comment by Johan Hendrik Ehlers [ 03/Jul/12 ]

I just noticed that this is only an issue if the member has a protected scope in the mapped super class, it works fine for private members.

Comment by Lukas Domnick [ 10/Dec/12 ]

As of Doctrine 2.3.0, Symfony 2.1.3, this behaviour is still reproducable.
Mr. Ehlers is correct; generation will work correctly when the super class' properties are set to private scope. However, in that case the Proxy Object's lazy loading can't set the properties in question.





[DDC-1893] Doctrine\ORM\Mapping\Driver\AnnotationDriver::create() not updated for new annotation readers Created: 26/Jun/12  Updated: 08/Jul/12  Resolved: 08/Jul/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: Mapping Drivers
Affects Version/s: 2.2
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Minor
Reporter: Vašek Purchart Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

After refactoring of annotation readers, there are new defaults and the current implementation calls undefined method, because Doctrine\Common\Annotations\AnnotationReader has been refactored too. The new way should be probably requiring Doctrine\Common\Annotations\Reader interface as $reader parameter and if not present constructing the default as in Doctrine\ORM\Configuration::create :

AnnotationRegistry::registerFile(_DIR_ . '/Mapping/Driver/DoctrineAnnotations.php');

$reader = new \Doctrine\Common\Annotations\SimpleAnnotationReader();
$reader->addNamespace('Doctrine\ORM\Mapping');
$reader = new \Doctrine\Common\Annotations\CachedReader($reader, new ArrayCache());



 Comments   
Comment by Marco Pivetta [ 06/Jul/12 ]

Looking into this today

Comment by Benjamin Eberlei [ 06/Jul/12 ]

$config->newDefaultAnnotationDriver should have a flag for picking the simple or the "ORM
" prefixed reader

Comment by Marco Pivetta [ 08/Jul/12 ]

Handled in DDC-1915 (https://github.com/doctrine/doctrine2/pull/396)





[DDC-1848] "QueryException: Invalid parameter number: number of bound variables does not match number of tokens" with "dev-master" of Doctrine\ORM + Pagerfanta. Created: 30/May/12  Updated: 08/Jul/12  Resolved: 08/Jul/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: Git Master
Fix Version/s: 2.3

Type: Bug Priority: Minor
Reporter: Paweł Jędrzejewski Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 1
Labels: None


 Description   

Using Symfony2 master with Doctrine\ORM master & Pagerfanta paginator (which uses Doctrine paginator internally) causes this exception.

"QueryException: Invalid parameter number: number of bound variables does not match number of tokens". Works fine with the master of Symfony & same version of Pagerfanta, but with 2.2 of Doctrine ORM.

Full app to see it is available here: http://github.com/Sylius/Sylius-Sandbox.

Full trace (without twig and Symfony part)

[1/2] QueryException: Invalid parameter number: number of bound variables does not match number of tokens
in /home/pjedrzejewski/Sylius.org/workspace/Sandbox/vendor/doctrine/orm/lib/Doctrine/ORM/Query/QueryException.php at line 72
at QueryException ::invalidParameterNumber ()
in /home/pjedrzejewski/Sylius.org/workspace/Sandbox/vendor/doctrine/orm/lib/Doctrine/ORM/Query.php at line 255
at Query ->_doExecute ()
in /home/pjedrzejewski/Sylius.org/workspace/Sandbox/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php at line 737
at AbstractQuery ->execute (null, '3')
in /home/pjedrzejewski/Sylius.org/workspace/Sandbox/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php at line 562
at AbstractQuery ->getScalarResult ()
in /home/pjedrzejewski/Sylius.org/workspace/Sandbox/vendor/doctrine/orm/lib/Doctrine/ORM/Tools/Pagination/Paginator.php at line 144
at Paginator ->count ()
at count (object(Paginator))
in /home/pjedrzejewski/Sylius.org/workspace/Sandbox/vendor/pagerfanta/pagerfanta/src/Pagerfanta/Adapter/DoctrineORMAdapter.php at line 75
at DoctrineORMAdapter ->getNbResults ()
in /home/pjedrzejewski/Sylius.org/workspace/Sandbox/vendor/pagerfanta/pagerfanta/src/Pagerfanta/Pagerfanta.php at line 167
at Pagerfanta ->getNbResults ()
in /home/pjedrzejewski/Sylius.org/workspace/Sandbox/vendor/pagerfanta/pagerfanta/src/Pagerfanta/Pagerfanta.php at line 190
at Pagerfanta ->haveToPaginate ()



 Comments   
Comment by Саша Стаменковић [ 31/May/12 ]

I tested Sylius against this issue with each commit from doctrine master branch, and I find out that bug appeared in this https://github.com/doctrine/doctrine2/commit/1635e0af4b06ef3015205563b59b505ae3fac69d commit.

Comment by Marco Pivetta [ 08/Jul/12 ]

Could you check if this isn't the same problem reported at DDC-1803?

Comment by Benjamin Eberlei [ 08/Jul/12 ]

Fixed





[DDC-1845] Implements a QuoteStrategy to fix quote problems Created: 28/May/12  Updated: 25/Jun/12  Resolved: 25/Jun/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: Mapping Drivers
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Improvement Priority: Minor
Reporter: Fabio B. Silva Assignee: Fabio B. Silva
Resolution: Fixed Votes: 0
Labels: None


 Description   

As discussed to fix http://www.doctrine-project.org/jira/browse/DDC-1719
and other quote problems we need a quote strategy.

The QuoteStrategy should implements methods like :

function getColumnName($fieldName, ClassMetadata $class)
function getTableName(ClassMetadata $class)
function getJoinTableName($relation, ClassMetadata $class)
function getIdentifierColumnNames(ClassMetadata $class)
function getColumnAlias($columnName, $counter, ClassMetadata $class = null)

All current quotes will be replaced by one default QuoteStrategy.
That allows users find solutions themselves for weird quote cases.

Related Tickets :

http://www.doctrine-project.org/jira/browse/DDC-1719
http://www.doctrine-project.org/jira/browse/DDC-142
http://www.doctrine-project.org/jira/browse/DDC-1843
http://www.doctrine-project.org/jira/browse/DDC-1831



 Comments   
Comment by Fabio B. Silva [ 25/Jun/12 ]

Fixed by : https://github.com/doctrine/doctrine2/commit/cb72219b118c158c9b5344c4b81ff2b1a9149ab0





[DDC-1065] Exception message unclear when persisting a null object Created: 09/Mar/11  Updated: 22/Dec/11  Resolved: 22/Dec/11

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: Git Master
Fix Version/s: 2.3
Security Level: All

Type: Improvement Priority: Minor
Reporter: Francois Zaninotto Assignee: Fabio B. Silva
Resolution: Fixed Votes: 0
Labels: None
Environment:

CentOS, symfony2 SE



 Description   

When persisting a null object in the entity manager, the exception message says "NULL", which is not very helpful. The problem lies at the beginning of Doctrine/ORM/EntityManager::persist(), where the exception should be replaced by:

if ( ! is_object($entity)) {
throw new \InvalidArgumentException(sprintf('Cannot persist variable of type %s. persist() expects an Entity object.', gettype($entity)));
}



 Comments   
Comment by Benjamin Eberlei [ 22/Dec/11 ]

This issue is referenced in Github Pull-Request GH-236
https://github.com/doctrine/doctrine2/pull/236

Comment by Benjamin Eberlei [ 22/Dec/11 ]

Related Pull Request was closed: https://github.com/doctrine/doctrine2/pull/236

Comment by Guilherme Blanco [ 22/Dec/11 ]

Fixed by merge: https://github.com/doctrine/doctrine2/commit/ec58285b3f05de1c1b7a127fedb12021dccf0762





[DDC-1737] MEDIUMTEXT field Created: 29/Mar/12  Updated: 23/May/12  Resolved: 23/May/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Minor
Reporter: Oleg Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None
Environment:

Ubuntu/CentOS



 Description   

I have a field which I want to be mysql mediumtext
/**

  • @var string $description
  • @ORM\Column(name="description", type="string", length=65536)
    */
    private $description;

Everything is fine, field created as 'mediumtext'
but whenever I run
php app/console doctrine:schema:update --dump-sql

I get
ALTER TABLE table CHANGE description description MEDIUMTEXT NOT NULL;
though description is MEDIUMTEXT already.



 Comments   
Comment by Guilherme Blanco [ 23/May/12 ]

Issue seems to be fixed already in master.

Coverage test:
https://github.com/doctrine/dbal/commit/4030787aa178b5c85d4717a75c43eb122edbd68d





[DDC-1719] When tablename or field name contains an hyphen it generates an error Created: 21/Mar/12  Updated: 25/Jun/12  Resolved: 25/Jun/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.2
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Minor
Reporter: Laurens Coudeville Assignee: Fabio B. Silva
Resolution: Fixed Votes: 0
Labels: None
Environment:

PHP 5.3



 Description   

In my database I have a table with '-' (hyphen) in the names of the tables and fields. But when mapping using annotations you get a mysql error because it generates a query that is not conform the mysql syntax. When using a hyphen in field or tablename (or others) you have to place it between quotes.

The name of the table can be resolved using quotes in the table name, in code it means:

@Table(name="directory-file") to @Table(name="`directory-file`"), you can't use this solution with the in the fields because the alias (AS in mysql syntax) also contains a '-' . Which results in a mysql error.

Failing code:

/**

  • @author Laurens
  • @Entity
  • @Table(name="directory-file")
    */
    class Directory_File {

/** @Id @Column(name="liddirectory-file",type="bigint") @GeneratedValue * */
protected $liddirectory_file;
}



 Comments   
Comment by Fabio B. Silva [ 25/Jun/12 ]

Fixed by : https://github.com/doctrine/doctrine2/commit/cb72219b118c158c9b5344c4b81ff2b1a9149ab0





[DDC-1694] Entity Generator uses wrong DataTypes for docBlocks Created: 11/Mar/12  Updated: 05/May/12  Resolved: 05/May/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: Git Master
Fix Version/s: 2.3

Type: Bug Priority: Minor
Reporter: Rafael Dohms Assignee: Fabio B. Silva
Resolution: Fixed Votes: 0
Labels: None


 Description   

When using the Doctrine\ORM\Tools\EntityGenerator, largely used by Symfony, the wrong data types are used in the docblocks. For example:

@param text $description

Text needs to be converted to "string" in this case. So there needs to be proper Doctrine Data Type to php type as well as the conversion to DBAL that is already done.

Examples:
smallint => int
bigint => int
text => string
datetime => \DateTime,
datetimetz, => \DateTime
etc...






[DDC-1697] DQL Query with key=>value array in parameter Created: 12/Mar/12  Updated: 25/Mar/12  Resolved: 25/Mar/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.2.1
Fix Version/s: 2.3

Type: Improvement Priority: Minor
Reporter: waldo Assignee: Fabio B. Silva
Resolution: Fixed Votes: 0
Labels: None
Environment:

PHP Version 5.3.3-1ubuntu9.10, Symfony 2.0.11



 Description   

In he method "processParameterValue" in the class Doctrine\ORM\Query line 303, a "for" loop is use for construct the parameter query.

But if in the query parameter we pass a key=>value array, the method throw an error.

A little example :
$aId = array(0 => "Paris", 3 => "Canne", 9 => "St Julien");

$dql = $this->_em->createQueryBuilder();
$dql->select('c.ID')
->from('BOD\ModelBundle\Entity\City', 'c')
->where('c.IC IN (:cityIDs)')
->setParameter('cityIDs', $aId);

return $dql->getQuery()->execute();

The method "processParameterValue" throw an error because he don't found the index 1.

But if we replace the "for" loop by a foreach in Doctrine\ORM\Query::processParameterValue() :
foreach ($value as $keyValue => $oneValue) {
$paramValue = $this->processParameterValue($oneValue);

// TODO: What about Entities that have composite primary key?
$value[$keyValue] = is_array($paramValue) ? $paramValue[key($paramValue)] : $paramValue;
}

It work really fine.

I remain at your disposal for any further information.

Thanks for all!



 Comments   
Comment by Fabio B. Silva [ 25/Mar/12 ]

Fixed by : https://github.com/doctrine/doctrine2/commit/8a52e3033b51f0f0b97e1ee75477644484debf2b





[DDC-1673] ProxyFactory method generateProxyClasses argument $toDir does not affect anything Created: 29/Feb/12  Updated: 03/Mar/12  Resolved: 03/Mar/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: Git Master
Fix Version/s: 2.2.1, 2.3
Security Level: All

Type: Bug Priority: Minor
Reporter: Aigars Gedroics Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

See my note in the github changeset - https://github.com/doctrine/doctrine2/commit/a029b284234065a03dab4241b29f0325975eeac6#L1L116.

Full method code on the master - https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Proxy/ProxyFactory.php#L116.



 Comments   
Comment by Guilherme Blanco [ 03/Mar/12 ]

Fixed in https://github.com/doctrine/doctrine2/commit/bf80ee6a30f04aed406a3253ef7459b4fcf11bda

Comment by Benjamin Eberlei [ 03/Mar/12 ]

Merged into 2.2





[DDC-559] Allow table name and column names to be modified by a user-supplied inflector Created: 29/Apr/10  Updated: 24/Dec/11  Resolved: 24/Dec/11

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: Mapping Drivers
Affects Version/s: 2.0-BETA1
Fix Version/s: 2.3
Security Level: All

Type: New Feature Priority: Minor
Reporter: Marc Hodgins Assignee: Fabio B. Silva
Resolution: Fixed Votes: 0
Labels: None


 Description   

With the annotation mapping driver, table names default to the same as the class name, and table columns default to the same name as the field (class property) name.

/** @Entity */
class MyEntity // db table will by default be "MyEntity"
{
    // ...

    /**
     * @Column(type="string")
     */
    protected $myProperty; // defaults to table column "myProperty" 
}

It would be great if we could override this behavior by passing in a custom inflector. So for example you could default all camelCase fields to be underscore_separated as column names in the database without needing to manually specify this in the annotations.



 Comments   
Comment by Roman S. Borschel [ 30/Apr/10 ]

I think Hibernate, for example, has naming strategies for this and you can implement your own custom NamingStrategy that implements a specific (default) naming convention. Maybe we want a similar approach.

Comment by Christian Heinrich [ 21/May/10 ]

Whats a use case for this? One could use individual table / column names via hardcoding. (@table, i guess. see manual) Is this unwanted?

Comment by Marc Hodgins [ 22/May/10 ]

Sure there is a use case. With a large schema, hardcoding via individual @table and @column annotations is error-prone. A global "default" inflector (or naming strategy, as Roman suggests) would much cleaner. Allowing customization of "defaults" doesn't seem unreasonable to me.

Comment by Benjamin Eberlei [ 23/Dec/11 ]

This issue is referenced in Github Pull-Request GH-241
https://github.com/doctrine/doctrine2/pull/241

Comment by Benjamin Eberlei [ 24/Dec/11 ]

Related Pull Request was closed: https://github.com/doctrine/doctrine2/pull/241

Comment by Guilherme Blanco [ 24/Dec/11 ]

Fixed in https://github.com/doctrine/doctrine2/commit/abb258c951dd416fc5325ef548d15c7acd35703e





Look into deferring foreign key checks until flush finished (DDC-954)

[DDC-369] Bulk-Delete on Self-Referencing CTI fails with FK Error Created: 24/Feb/10  Updated: 23/May/12  Resolved: 23/May/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.0-ALPHA4
Fix Version/s: 2.3
Security Level: All

Type: Sub-task Priority: Minor
Reporter: Benjamin Eberlei Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   
    public function testDeleteAs()
    {
        $dql = 'DELETE Doctrine\Tests\Models\Company\CompanyEmployee AS p';
        $this->_em->createQuery($dql)->getResult();

        $this->assertEquals(0, count($this->_em->createQuery(
            'SELECT count(p) FROM Doctrine\Tests\Models\Company\CompanyEmployee p')->getResult()));
    }

fails with:

Doctrine\Tests\ORM\Functional\AdvancedDqlQueryTest::testDeleteAs()
Exception: [PDOException] SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`doctrine_tests`.`company_persons`, CONSTRAINT `company_persons_ibfk_1` FOREIGN KEY (`spouse_id`) REFERENCES `company_persons` (`id`))
With queries:
25. SQL: 'DELETE FROM company_persons WHERE (id) IN (SELECT id FROM company_persons_id_tmp)' Params:
24. SQL: 'DELETE FROM company_employees WHERE (id) IN (SELECT id FROM company_persons_id_tmp)' Params:
23. SQL: 'DELETE FROM company_managers WHERE (id) IN (SELECT id FROM company_persons_id_tmp)' Params:
22. SQL: 'INSERT INTO company_persons_id_tmp (id) SELECT t0.id FROM company_employees t0 INNER JOIN company_persons c0_ ON t0.id = c0_.id LEFT JOIN company_managers c1_ ON t0.id = c1_.id' Params:
21. SQL: 'CREATE TEMPORARY TABLE company_persons_id_tmp (id INT NOT NULL, PRIMARY KEY(id))' Params:
20. SQL: 'INSERT INTO company_persons_friends (person_id, friend_id) VALUES (?, ?)' Params: '15', '14'
19. SQL: 'INSERT INTO company_persons_friends (person_id, friend_id) VALUES (?, ?)' Params: '15', '13'
18. SQL: 'INSERT INTO company_persons_friends (person_id, friend_id) VALUES (?, ?)' Params: '15', '16'
17. SQL: 'INSERT INTO company_persons_friends (person_id, friend_id) VALUES (?, ?)' Params: '14', '15'
16. SQL: 'INSERT INTO company_persons_friends (person_id, friend_id) VALUES (?, ?)' Params: '14', '13'
15. SQL: 'INSERT INTO company_persons_friends (person_id, friend_id) VALUES (?, ?)' Params: '13', '15'
14. SQL: 'INSERT INTO company_persons_friends (person_id, friend_id) VALUES (?, ?)' Params: '13', '14'
13. SQL: 'INSERT INTO company_persons_friends (person_id, friend_id) VALUES (?, ?)' Params: '16', '15'
12. SQL: 'UPDATE company_persons SET spouse_id = ? WHERE id = ?' Params: '13', '14'
11. SQL: 'UPDATE company_persons SET spouse_id = ? WHERE id = ?' Params: '14', '13'
10. SQL: 'INSERT INTO company_employees (id, salary, department) VALUES (?, ?, ?)' Params: '16', '100000', 'IT'
9. SQL: 'INSERT INTO company_managers (id, title, car_id) VALUES (?, ?, ?)' Params: '16', 'Foo', '4'
8. SQL: 'INSERT INTO company_persons (name, spouse_id, discr) VALUES (?, ?, ?)' Params: 'Roman B.', '', 'manager'
7. SQL: 'INSERT INTO company_cars (brand) VALUES (?)' Params: 'BMW'
6. SQL: 'INSERT INTO company_employees (id, salary, department) VALUES (?, ?, ?)' Params: '15', '800000', 'IT2'
5. SQL: 'INSERT INTO company_persons (name, spouse_id, discr) VALUES (?, ?, ?)' Params: 'Jonathan W.', '', 'employee'
4. SQL: 'INSERT INTO company_employees (id, salary, department) VALUES (?, ?, ?)' Params: '14', '400000', 'IT2'
3. SQL: 'INSERT INTO company_persons (name, spouse_id, discr) VALUES (?, ?, ?)' Params: 'Guilherme B.', '', 'employee'
2. SQL: 'INSERT INTO company_employees (id, salary, department) VALUES (?, ?, ?)' Params: '13', '200000', 'IT'
Trace:
/home/benny/code/php/wsnetbeans/Doctrine/trunk/lib/Doctrine/DBAL/Connection.php:630
/home/benny/code/php/wsnetbeans/Doctrine/trunk/lib/Doctrine/ORM/Query/Exec/MultiTableDeleteExecutor.php:123
/home/benny/code/php/wsnetbeans/Doctrine/trunk/lib/Doctrine/ORM/Query.php:198
/home/benny/code/php/wsnetbeans/Doctrine/trunk/lib/Doctrine/ORM/AbstractQuery.php:511
/home/benny/code/php/wsnetbeans/Doctrine/trunk/lib/Doctrine/ORM/AbstractQuery.php:349
/home/benny/code/php/wsnetbeans/Doctrine/trunk/tests/Doctrine/Tests/ORM/Functional/AdvancedDqlQueryTest.php:93
/home/benny/code/php/wsnetbeans/Doctrine/trunk/tests/Doctrine/Tests/OrmFunctionalTestCase.php:253

fixture is:

    public function generateFixture()
    {
        $car = new CompanyCar('BMW');

        $manager1 = new CompanyManager();
        $manager1->setName('Roman B.');
        $manager1->setTitle('Foo');
        $manager1->setDepartment('IT');
        $manager1->setSalary(100000);
        $manager1->setCar($car);

        $person2 = new CompanyEmployee();
        $person2->setName('Benjamin E.');
        $person2->setDepartment('IT');
        $person2->setSalary(200000);

        $person3 = new CompanyEmployee();
        $person3->setName('Guilherme B.');
        $person3->setDepartment('IT2');
        $person3->setSalary(400000);

        $person4 = new CompanyEmployee();
        $person4->setName('Jonathan W.');
        $person4->setDepartment('IT2');
        $person4->setSalary(800000);

        $person2->setSpouse($person3);

        $manager1->addFriend($person4);
        $person2->addFriend($person3);
        $person2->addFriend($person4);
        $person3->addFriend($person4);

        $this->_em->persist($car);
        $this->_em->persist($manager1);
        $this->_em->persist($person2);
        $this->_em->persist($person3);
        $this->_em->persist($person4);
        $this->_em->flush();
        $this->_em->clear();
    }


 Comments   
Comment by Roman S. Borschel [ 24/Feb/10 ]

That should rather be ->executeUpdate() instead of ->getResult() but thats surely not the problem here.

Comment by Roman S. Borschel [ 24/Feb/10 ]

An option is to check all associations and if there is a self-referential one execute UPDATE statements to set the FKs to null.

However, this is a bit of extra work and I dont consider this scenario extremely common together with the combination of bulk deletes.

Pushing priority down for now.

Comment by Guilherme Blanco [ 23/May/12 ]

Added coverage to this specific situation. All passing.
Closing the ticket as fixed for 2.3.

https://github.com/doctrine/doctrine2/commit/3e601c3a53226ce981fe82db164f297a8d605ae7





[DDC-451] Add GUID/UUID Id Generator Created: 20/Mar/10  Updated: 13/Aug/12  Resolved: 12/Mar/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.0-ALPHA4
Fix Version/s: 2.3
Security Level: All

Type: New Feature Priority: Minor
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 3
Labels: None


 Description   

We should add an IdGenerator that facilitates the DB Vendors UUID()/GUID() generation facilities.

Although these IdGenerators take more space compared to other Generators there are use-cases which can be only solved with this kind of Id Generator.



 Comments   
Comment by Guilherme Blanco [ 20/Mar/10 ]

Here is a basic GUID generator.

class Guid
{
    /**
     * Generate a GUID
     *
     * @return string
     */
    public static function generate()
    {
        $cpuname     = getenv('COMPUTERNAME');
        $address     = isset($_SERVER['SERVER_ADDR']) ? @$_SERVER['SERVER_ADDR'] : uniqid(hash("md5", time()), true) . time();
        $address     = (trim($cpuname) == '' ? crypt(uniqid(rand(), true)) : $cpuname) . '/' . $address;
        $milisecs        = microtime();
        $randomLong  = (rand(0, 1))? '-':'';
        $randomLong .= rand(1000, 9999).rand(1000, 9999).rand(1000, 9999).rand(100, 999).rand(100, 999);
        
        $string = $address . ':' . $milisecs . ':' . $randomLong;
        $hashString = strtoupper(md5($string));
        
        return substr($hashString, 0, 8).'-'.substr($hashString, 8, 4).'-'.substr($hashString, 12, 4).'-'.substr($hashString, 16, 4).'-'.substr($hashString, 20);
    }
    
    
    /**
     * Verifies if a string is a valid Guid generated acording to this class
     *
     * @param string $guid Guid to be analyzed
     * @return boolean
     */
    public static function match($guid)
    {
        
        $match = preg_match("/^([A-F0-9]{8}-[A-F0-9]{4}-[A-F0-9]{4}-[A-F0-9]{4}-[A-F0-9]{12})$/", $guid);
        
        return $match;
    }
}
Comment by Andy Aja deh [ 12/May/10 ]

I agree, there are some application features that can only be done with GUID.

Comment by Steffen Vogel [ 25/Jul/10 ]

Oh, thats a quite simple implementation of a UUID/GUID generator.

I would prefer something like this:
http://github.com/volkszaehler/volkszaehler.org/blob/master/backend/lib/Util/UUID.php

Its a RFC2144 compatible implementation for UUIDs

Comment by Aigars Gedroics [ 27/Jul/11 ]

Here is complete code how to do this - http://ranskills.wordpress.com/2011/05/26/how-to-add-a-custom-id-generation-strategy-to-doctrine-2-0/.

Comment by Maarten de Keizer [ 23/Nov/11 ]

A couple of months ago I created 2 pull requests for this feature (https://github.com/doctrine/doctrine2/pull/127 and https://github.com/doctrine/dbal/pull/58). It would be nice if the feature is in the next Doctrine release.

Comment by Benjamin Eberlei [ 12/Mar/12 ]

Implemented

Comment by Benjamin Eberlei [ 12/Mar/12