[DDC-2721] CLONE - doctrine-mapping.xsd sequence relation-entities Created: 03/Oct/13  Updated: 03/Oct/13

Status: Open
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: Benoît Burnichon Assignee: Guilherme Blanco
Resolution: Unresolved 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.

I looked in the repository and it seems xsd is not valid for all branches 2.1.x, 2.2, 2.3.4, 2.4.0-RC2 and master



 Comments   
Comment by Marco Pivetta [ 03/Oct/13 ]

Yes, order is not enforced in the driver itself either, so it could eventually be removed.





[DDC-2080] Entity's association changes after first call Created: 15/Oct/12  Updated: 15/Oct/12  Resolved: 15/Oct/12

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

Type: Bug Priority: Trivial
Reporter: Koby Soto Assignee: Benjamin Eberlei
Resolution: Invalid Votes: 0
Labels: None


 Description   

i am using the latest version of doctrine: 2.3

when you call a generated association function, the first time everything is fine:

$authors = $book->getBookToAuthors();
//$authors = array(5)
but the second time instead of returning the array of all associations it returns the last hydrated entity:

$authors = $book->getBookToAuthors();
//$authors = BookToAuthor entity
that happens even when there is nothing else happening:

$authors = $book->getBookToAuthors(); //will work
$authors = $book->getBookToAuthors(); //won't work
the function of getBookToAuthors() is:

public function getBookToAuthors()

{ return $this->bookToAuthors; }

and the mapping is as follows:

/**

  • @var BookToAuthor[]
    *
  • @OneToMany(targetEntity="BookToAuthor", mappedBy="book", cascade= {"persist"}

    )

  • @JoinColumn(name="id", referencedColumnName="book_id", onDelete="cascade")
    */
    private $bookToAuthors;
    please advise. i don't know what to do...


 Comments   
Comment by Koby Soto [ 15/Oct/12 ]

sorry sorry sorry
it was a mistake in the association target side.

the target had One-To-One association instead of Many-To-One





[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-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-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-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-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-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-1985] Call to undefined method ProxyException::proxyDirectoryNotWritable Created: 16/Aug/12  Updated: 17/Aug/12  Resolved: 17/Aug/12

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

Type: Bug Priority: Major
Reporter: Mark van der Velden Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

I think it's fairly self explanatory, didn't supply a patch since I had no idea what text you wanted there

PHP Fatal error:  Call to undefined method Doctrine\ORM\Proxy\ProxyException::proxyDirectoryNotWritable() in .../orm/lib/Doctrine/ORM/Proxy/ProxyFactory.php on line 193


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

This issue is already fixed in master





[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-1977] Undefined index in ParameterTypeInferer Created: 10/Aug/12  Updated: 17/Apr/14  Resolved: 25/Aug/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.2.3
Fix Version/s: 2.3, 2.3.1
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-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-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-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-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-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-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-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-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-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-1931] Cache $oid and $className through method calls in UoW internals Created: 17/Jul/12  Updated: 24/Jul/12  Resolved: 24/Jul/12

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

Type: Improvement Priority: Minor
Reporter: Marco Pivetta Assignee: Marco Pivetta
Resolution: Invalid Votes: 0
Labels: None


 Description   

As suggested by Johannes Schmitt, calls in UoW can re-use $oid and $className by passing them to the various methods of UoW internals



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

Performance gain is nearly 0... Not worth it as far as I've seen.





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

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.1
Fix Version/s: 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-1919] Doctrine fails to escape entity with reserved name in various situations Created: 10/Jul/12  Updated: 19/Jul/12  Resolved: 11/Jul/12

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

Type: Bug Priority: Major
Reporter: Klaus Silveira Assignee: Benjamin Eberlei
Resolution: Invalid Votes: 0
Labels: None
Environment:

MySQL



 Description   

I have submitted a PR here, fixing part of this issue: https://github.com/doctrine/dbal/pull/166

However, it fails when UPDATE or INSERT is used. I'm using a very simple, and common, entity name: Group. Doctrine is failing to escape this in various situations, causing queries to fail in MySQL due to reserved keywords.



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

Can you try using the quoting strategy in master? By defining an '@Table(name="`Group`")' on your entity you should be able to fix this issue by yourself... Anyway, this is only available in latest master.
Please give it a try and let us know.

Comment by Klaus Silveira [ 11/Jul/12 ]

That hack, of course, fixes the problem. However, Doctrine is failing to escape entities with reserved keywords in various different situations and this should be a major problem, specially since there are many keywords that are common table names. Having to change the table name or escape the table name manually is not the best solution.

I have look through the code but could not find out why getQuotedTableName() is failing to quote the table name "Group". I fixed the other problem, involving schema creation, but this one i couldn't fix. That's why i'm opening the issue, hoping someone with more experience in the ORM codebase manages to fix it.

Comment by Marco Pivetta [ 11/Jul/12 ]

Klaus Silveira, doctrine won't quote (at least with the default strategy) a table called "Group". The default strategy will look for the sorrounding "`" ("`Group`").
Is it still failing to quote something in latest master? Can you write a simple example of a failure you are getting?

Comment by Klaus Silveira [ 11/Jul/12 ]

The failure is caused when querying anything related to an entity wich it's name is a reserved keyword, for example, an entity called "Group". I expected Doctrine to quote such table names.

Comment by Marco Pivetta [ 11/Jul/12 ]

Klaus Silveira did you put an @Table(name="`Group`") in it?

Comment by Marco Pivetta [ 11/Jul/12 ]

Please note that

Unable to find source-code formatter for language: php. Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml
@Table(name="Group")

and

Unable to find source-code formatter for language: php. Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml
@Table(name="`Group`")

are quite different. That's why I'm asking

Comment by Klaus Silveira [ 11/Jul/12 ]

As i said, that hack fixes the problem. But i don't believe that having to change the table name or escape the table name manually is the best solution. Doctrine should be doing that transparently, as it does for other situations (such as during schema creation). Why not during all other operations? Makes no sense at all.

Comment by Marco Pivetta [ 11/Jul/12 ]

This is not a hack... In ORM, "`" is not the MySQL identifier quote. It is exactly thought as a character with which you tell the ORM that the identifier should be quoted.
The default strategy does make use of it, so please use it.

Comment by Marco Pivetta [ 11/Jul/12 ]

Also, we won't collect the SQL reserved keywords, nor we can know what keywords are used in all vendors. The patch for the quoting strategy was exactly thought to allow end users to use insecure names for their objects/fields/indexes/etc but without having the ORM implement those checks for them (since it would just be messy and too "magic").

Please also reconsider your pull request on github too ( DBAL-298 ).

I'm closing this one

Comment by Klaus Silveira [ 11/Jul/12 ]

Then what's the purpose of Doctrine\DBAL\Platforms\Keywords\MySQLKeywords?

Comment by Marco Pivetta [ 11/Jul/12 ]

Klaus Silveira not sure, but it isn't used in ORM.

Comment by Benjamin Eberlei [ 19/Jul/12 ]

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





[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-1915] [GH-396] DDC-1893 - Updating configuration to reflect latest Doctrine Common changes Created: 08/Jul/12  Updated: 02/Nov/13  Resolved: 08/Jul/12

Status: Closed
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: Marco Pivetta
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/396

Message:

This PR fixes DDC-1893 (http://www.doctrine-project.org/jira/browse/DDC-1893).

The `getDefaultAnnotationDriver` method was changes to stop supporting older incompatible Doctrine Common versions in favour of the newer logic.

Also, changing logic so that the SimpleAnnotationReader is no more the
default one. An additional parameter for the method will allow using it (this is a BC break!)

The CS fixes that were additionally implemented (along with other minor changes
that do not affect BC compatibility are caused by a CS sniff via IDE.



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

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

Comment by Doctrine Bot [ 02/Nov/13 ]

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





[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-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-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-1900] Impossibility to override built-in SQL functions Created: 30/Jun/12  Updated: 05/Jul/12  Resolved: 05/Jul/12

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

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

Any



 Description   

Doctrine doesn't allow to to create own SQL function for DQL if that function is already defined as "built-in". An example could be custom DATE_ADD implementation.
Method FunctionDeclaration() in Doctrine\ORM\Query\Parser gives higher priority to built-in SQL functions, even if they are not
usable for a specific situation, and registering of own datetime function doesn't help. This issue makes it impossible to use some advanced Doctrine extensions,
for example https://github.com/beberlei/DoctrineExtensions that provide fuller implementations.
Considering the fact that someone may want to use ready components provided by the community, and being new to Doctrine can't figure out the way to hack
or workaround this, the issue is a major one.



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

Just name the method differently.

Comment by Alex Oroshchuk [ 05/Jul/12 ]

To rename the method one has to KNOW that he has to rename it, i.e. to know about this issue.
One has to SPEND hours (like me) on understanding that there are built-in implementations and other extensions that are meant
to provide necessary features just don't work. IMHO it's just too cruel to leave it as is.

As to the renaming: is it ok to go and edit source code (change class name at least) provided by someone else and then merge all the sources when new releases appear?
Is that the only way flexible Doctrine provides? Also, I want DQL to be as close as possible to real SQL. I don't want to see weird stuff like MY_DATE_ADD or BETTER_DATE_ADD, or whatever it will be.
Syntax matters, we are all writers, code writers...

I re-open the issue in order to attract more attention, but you are free to decide how to treat it. Hope you'll find the best solution. A short line in documentation could notify about current limitations and save hours for people
who want to be productive with Doctrine.

Comment by Benjamin Eberlei [ 05/Jul/12 ]

Printing statements in bold isnt helpful. This is open-source.

However, you are right that this could be more user-friendly. Its now throwing an exception when an internal function is attempted to be overwritten.





[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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-1843] CLONE -Join columns can't be quoted Created: 28/May/12  Updated: 15/Aug/12  Resolved: 15/Aug/12

Status: Closed
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: Marc Easen Assignee: Fabio B. Silva
Resolution: Fixed Votes: 0
Labels: None

Attachments: File quoted_joins_fix.diff    

 Description   

Join columns can't be quoted like columns using name="`quoted`". Using annotation driver.

/**
 * @ORM\Table(
 *      name="`category`",
 *      indexes={
 *          @ORM\Index(
 *              name="fk_category_parentId",
 *              columns={"parentId"}
 *          )
 *      },
 *      uniqueConstraints={
 *          @ORM\UniqueConstraint(
 *              name="uq_category_nameParentId",
 *              columns={"name", "parentId"}
 *          )
 *      }
 * )
 */
class Category
{
    /**
     * @ORM\Id
     * @ORM\Column(type="smallint", name="`id`")
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

    /**
     * @ORM\Column(type="smallint", name="`parentId`", nullable=true)
     */
    protected $parentId;

    /**
     * @ORM\Column(type="string", length=50, name="`name`")
     */
    protected $name;

    /**
     * @ORM\ManyToOne(targetEntity="Category", inversedBy="categories")
     * @ORM\JoinColumn(name="parentId", referencedColumnName="id", onDelete="CASCADE", onUpdate="NO ACTION")
     */
    protected $category;
}

... 


public function load(ObjectManager $manager)
    {
        $parent = new Category();
        $parent->setName('parent');
        $manager->persist($parent);
        $manager->flush();

        $child = new Category();
        $child->setName('parent');
        $child->setParentId($parent->getId());
        $child->setCategory($parent);

        $manager->persist($child);
        $manager->flush();
}

Result: Invalid parameter number: number of bound variables does not match number of tokens



 Comments   
Comment by Fabio B. Silva [ 28/May/12 ]

code format

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

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

Comment by Marc Easen [ 05/Jul/12 ]

When inserting into an entity which has quoted columns and unquoted JoinColumn the generated SQL includes the correct number of parameters but the incorrect columns names and bind parameters:

INSERT INTO `table` (`c1`, c1) VALUES (?, ?)

Comment by Marc Easen [ 05/Jul/12 ]

See https://github.com/doctrine/doctrine2/pull/390

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

Hi Marc,

Could you attach your entities or a test case please ?

Thanks

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

Marc, why do you need to quoted columns and unquoted join column ?

For sure duplicated columns is a problem, but your use case does not make sense for me..

Comment by Fabio B. Silva [ 15/Aug/12 ]

More details about the related problem : https://github.com/doctrine/doctrine2/pull/390





[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-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-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-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-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-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-1800] Paginator results is wrong if your query use order by clause Created: 27/Apr/12  Updated: 17/Apr/14  Resolved: 29/Aug/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.2.2
Fix Version/s: 2.3, 2.3.1
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-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-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-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-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-1768] [GH-330] improved exception message Created: 05/Apr/12  Updated: 27/Jul/14  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

Comment by Doctrine Bot [ 27/Jul/14 ]

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





[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-1764] [GH-326] 2.1.x setDiscriminatorMap fix Created: 04/Apr/12  Updated: 27/Jul/14  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

Comment by Doctrine Bot [ 27/Jul/14 ]

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





[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-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-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-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: 19/May/14  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

Comment by Doctrine Bot [ 19/May/14 ]

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





[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-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-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-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-1725] [GH-309] Fix DDC-1686 Created: 25/Mar/12  Updated: 19/May/14  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

Comment by Doctrine Bot [ 19/May/14 ]

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





[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-1718] types generated by Doctrine\ORM\Tools\EntityGenerator (in docblock) are sometimes wrong Created: 21/Mar/12  Updated: 29/Jul/12  Resolved: 29/Jul/12

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

Type: Improvement Priority: Trivial
Reporter: Brikou Carré Assignee: Fabio B. Silva
Resolution: Fixed Votes: 0
Labels: None


 Description   

"@return smallint" instead of "@return integer"... same for date... etc...

BTW it could be really great to have issues handled by github... (no need to create another account)



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

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





[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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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 :D }

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-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-1591] Paginator: ResultVariable cannot be used in HavingClause Created: 09/Jan/12  Updated: 15/Mar/12  Resolved: 15/Mar/12

Status: Closed
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: Christian Raue Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

Using the QueryBuilder, I'm getting the message

Notice: Undefined index: distance in vendor\doctrine\lib\Doctrine\ORM\Query\SqlWalker.php line 2128

when trying to add a "having" clause for the field "distance", which is defined in the "select" part of the statement:

$queryBuilder
    ->select('myEntity, MY_FUNCTION() AS distance')
    ->having('distance <= 10')
;


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

Christian, I couldn't reproduce.

Can you give more details ?

Thanks.

Comment by Christian Raue [ 15/Jan/12 ]

I tried it again and found out that it could also be an issue in https://github.com/whiteoctober/Pagerfanta rather in Doctrine itself because my query is passed to that pager to show a sliced result. Maybe that issue could already be resolved by https://github.com/whiteoctober/Pagerfanta/pull/46. Will give it a try...

Comment by Christian Raue [ 15/Jan/12 ]

In fact, applying that patch made the query work. So this is not a Doctrine issue.

Comment by Christian Raue [ 10/Feb/12 ]

Since the PR mentioned was not merged and Doctrine's pagination is used now, the issue still exists and I cannot use a result variable in a "having" clause. But I'd like to.

Comment by Christophe Coevoet [ 10/Feb/12 ]

This ticket is indeed invalid as it is talking about the query builder. Please open a dedicated ticket for the pagination issue

Comment by Christian Raue [ 10/Feb/12 ]

But I am using the QueryBuilder and then passing the query to a DoctrineORMAdapter instance. The error message didn't change, just the line number:

Notice: Undefined index: distance in vendor\doctrine\lib\Doctrine\ORM\Query\SqlWalker.php line 2142

But I can confirm that this error doesn't occur when not using a paginator. How to continue?

Comment by Benjamin Eberlei [ 10/Feb/12 ]

Which paginator are you using?

Comment by Christian Raue [ 10/Feb/12 ]

Still https://github.com/whiteoctober/Pagerfanta/

Comment by Benjamin Eberlei [ 20/Feb/12 ]

Renamed and assigned issue.

Comment by Alexander [ 15/Mar/12 ]

Fixed as sander was kind enough to resubmit the code to the doctrine2 repository now instead:
https://github.com/doctrine/doctrine2/pull/298





[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 Resolved

 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-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-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-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-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-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-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-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-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-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: 18/Aug/14  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.

Comment by Doctrine Bot [ 05/Aug/14 ]

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

Comment by Doctrine Bot [ 18/Aug/14 ]

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





[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-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 P