[DDC-3551] [GH-1294] Avoid Connection error when calling ClassMetadataFactor::getAllMetadata() Created: 29/Jan/15  Updated: 29/Jan/15

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

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

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

Message:

Hi guys!

When you pair the ORM with DBAL 2.5.0, then getting the `targetPlatform` means that a connection will be made to the database. For that reason, it's really important to not get the `targetPlatform` unless it's absolutely needed. Currently, if you call `ClassMetadataFactor::getAllMetadata()`, it will try to determine `targetPlatform` (in `initialize()`), which will make a connection. And if that connection fails (e.g. no db yet), it will blow up - even though `getAllMetadata()` doesn't need the `targetPlatform`.

This fixes that, and in an absolutely BC way, since `targetPlatform` is private (yay!). This should fix a number of issues in userland, like symfony/symfony-standard#748 and symfony/symfony-standard#774.

This is a PR to master (per the guidelines), but the real target is 2.4, since it's the latest stable. The patch won't apply cleanly, but it's simple: remove from initialize, then replace all references to the new private method.

Thanks in advance! More details are on the commit message.






[DDC-3550] [GH-1293] EntityManager::__cosntruct() as public method Created: 28/Jan/15  Updated: 28/Jan/15

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

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

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

Message:






[DDC-3549] [GH-1292] Mark getSelectConditionStatementColumnSQL method as private Created: 28/Jan/15  Updated: 29/Jan/15  Resolved: 29/Jan/15

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

Type: Improvement Priority: Major
Reporter: Doctrine Bot Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: bc, persister


 Description   

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

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

Message:

The `Doctrine/\ORM\Persisters\BasicEntityPersister::getSelectConditionStatementColumnSQL` method has been marked as `private`.

The current `protected` mark is a bit unuseful since everything is already handled into the public method `getSelectConditionStatementSQL`.



 Comments   
Comment by Doctrine Bot [ 29/Jan/15 ]

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





[DDC-3548] [GH-1291] Conversion to PHP 5.4's short array syntax Created: 28/Jan/15  Updated: 28/Jan/15

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

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

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

Message:

Now that the minimum PHP version is 5.4, it would be good to encourage the use of the short array syntax `[]`.
Converting the existing codebase to this syntax will promote this good practice and encourage everyone to follow it.

I have converted the codebase with [a tool](https://gist.github.com/BenMorel/6994483) I wrote for personal projects:

find doctrine2 -type f -name '*.php' -exec php short-array-syntax-converter.php {} \;

The number of changes is quite large, but I'm confident that nothing is broken, and the passing tests confirm this.



 Comments   
Comment by Doctrine Bot [ 28/Jan/15 ]

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

Comment by Doctrine Bot [ 28/Jan/15 ]

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





[DDC-3547] [GH-1290] [Doc] [Reference] [Second Level Cache] Created: 27/Jan/15  Updated: 27/Jan/15  Resolved: 27/Jan/15

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

Type: Documentation Priority: Trivial
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: typo


 Description   

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

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

Message:

Updated reference for Second Level Cache (fixed some typos and docblocks).



 Comments   
Comment by Doctrine Bot [ 27/Jan/15 ]

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

Comment by Doctrine Bot [ 27/Jan/15 ]

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





[DDC-3546] [GH-1289] Improve test suite Created: 27/Jan/15  Updated: 27/Jan/15  Resolved: 27/Jan/15

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

Type: Improvement Priority: Minor
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: ci, performance, phpunit, testing, travis

Issue Links:
Duplicate
is duplicated by DDC-3540 [GH-1285] travis: remove unnecessary ... Resolved
Reference
relates to DDC-3540 [GH-1285] travis: remove unnecessary ... Resolved

 Description   

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

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

Message:

This PR adopts DBAL's latest test suite improvements from https://github.com/doctrine/dbal/pull/597/files, https://github.com/doctrine/dbal/pull/643/files, https://github.com/doctrine/dbal/pull/779 and https://github.com/doctrine/dbal/pull/758/files
Supersedes https://github.com/doctrine/doctrine2/pull/1285



 Comments   
Comment by Doctrine Bot [ 27/Jan/15 ]

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

Comment by Doctrine Bot [ 27/Jan/15 ]

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

Comment by Doctrine Bot [ 27/Jan/15 ]

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





[DDC-3545] Persist new object failed when it works with optimistic lock Created: 27/Jan/15  Updated: 27/Jan/15

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

Type: Bug Priority: Major
Reporter: Max Liu Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: dql, orm
Environment:

PHP 5.5



 Description   

When I was trying to persist a new object, Doctrine reported a exception:

An exception occurred while executing 'SELECT version FROM wallet WHERE user_id = ?' with params [{}]:

Catchable Fatal Error: Object of class XXXBundle\Entity\User could not be converted to string in /Users/XXX/WebSite/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php line 91

From the stack trace information, I found the original exception is:

Catchable Fatal Error: Object of class XXXBundle\Entity\User could not be converted to string

The reason is that the entity Wallet has a OneToOne mapping to entity User, and user property is also marked as primary key. When the wallet object persists, Doctrine try to fetch the new version id and use user property to find object. But Doctrine doesn't handle the primary key is an object, not a basic type. So PDO can't use a object as a query parameter.

My Entity:

class Wallet
{
    /**
     * ID
     * @var User
     *
     * @ORM\Id
     * @ORM\OneToOne(targetEntity="XXXBundle\Entity\User")
     * @ORM\JoinColumn(name="user_id", referencedColumnName="id")
     */
    private $user;

    /**
     * @var int
     *
     * @ORM\Version()
     * @ORM\Column(name="version", type="integer")
     */
    private $version;
}

I hope Doctrine team can solve this problem. My temporary solution is to override __toString method in User object. It is not elegant, doesn't it?



 Comments   
Comment by Marco Pivetta [ 27/Jan/15 ]

What exact version of the ORM is affected? Is master also behaving like this?

Comment by Max Liu [ 27/Jan/15 ]

It works well before I add version field. I didn't try with master version.





[DDC-3544] [GH-1288] Hotfix - #1169 - extra lazy one to many must be no-op when not doing orphan removal Created: 27/Jan/15  Updated: 28/Jan/15  Resolved: 28/Jan/15

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: Lazy Loading, ORM
Affects Version/s: 2.5
Fix Version/s: 2.5
Security Level: All

Type: Bug Priority: Blocker
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: collection, extra-lazy, lazy-loading, onetomany, orphanRemoval

Issue Links:
Dependency
is required for DDC-3343 `PersistentCollection::removeElement`... Resolved
is required for DDC-3536 [GH-1281] Hotfix/#1169 extra lazy one... Resolved

 Description   

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

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

Message:

See https://github.com/doctrine/doctrine2/pull/1281#issuecomment-71403668



 Comments   
Comment by Doctrine Bot [ 28/Jan/15 ]

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

Comment by Doctrine Bot [ 28/Jan/15 ]

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

Comment by Doctrine Bot [ 28/Jan/15 ]

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





[DDC-3543] How to map and use a DB View from Doctrine2 Created: 26/Jan/15  Updated: 26/Jan/15  Resolved: 26/Jan/15

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: Mapping Drivers, ORM
Affects Version/s: 2.4.7
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Reynier Perez Mira Assignee: Marco Pivetta
Resolution: Invalid Votes: 0
Labels: None


 Description   

I have a view on nomencladores schema called obtenerPaisesPorFabricanteProductoSolicitud. This is the content for the view:

    SELECT
    	ps.id AS psid,
    	ps.nombre,
    	fps.id AS fpsid
    FROM
    	(
    		(
    			nomencladores.pais ps
    			JOIN nomencladores.pais_fabricante_producto_solicitud pfps ON ((pfps.pais_id = ps.id))
    		)
    		JOIN negocio.fabricante_producto_solicitud fps ON (
    			(
    				pfps.fabricante_producto_solicitud_id = fps.id
    			)
    		)
    	);

I'm trying to map the view as follow:

    use Doctrine\ORM\Mapping as ORM;
    
    /**
     * @ORM\Entity
     * @ORM\Table(name="nomencladores.obtenerPaisesPorFabricanteProductoSolicitud", schema="nomencladores")
     */
    class ObtenerPaisesPorFabricanteProductoSolicitud
    {
        /**
         * @ORM\Id
         * @ORM\Column(name="psid", type="integer", nullable=false, unique=true)
         */
        protected $ps;
    
        /**
         * @ORM\Column(name="fpsid", type="integer")
         */
        protected $fps;
    
        /**
         * @ORM\Column(name="nombre", type="string")
         */
        protected $nombre;
    
        public function getPs()
        {
            return $this->ps;
        }
    
        public function getFps()
        {
            return $this->fps;
        }
    
        public function getNombre()
        {
            return $this->nombre;
        }
    }

But any time I run this code on it:

    $ent = $em->getRepository("AppBundle:ObtenerPaisesPorFabricanteProductoSolicitud")->findBy(
        array(
            "fps" => $entF->getId()
        )
    );

I got this result:

An exception occurred while executing 'SELECT t0.psid AS psid1,
t0.fpsid AS fpsid2, t0.nombre AS nombre3 FROM
nomencladores.obtenerPaisesPorFabricanteProductoSolicitud t0 WHERE
t0.fpsid = ?' with params [22]:
SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "nomencladores.obtenerpaisesporfabricanteproductosolicitud" does not
exist LINE 1: ...d1, t0.fpsid AS fpsid2, t0.nombre AS nombre3 FROM
nomenclado...

If I remove the annotations then the error transform on this:

Class "AppBundle\Entity\ObtenerPaisesPorFabricanteProductoSolicitud" is not a valid entity or mapped super class."

Why Doctrine2 or Symfony tries to execute the query instead go through the view? How I can execute the view from Symfony2/Doctrine2 side?



 Comments   
Comment by Marco Pivetta [ 26/Jan/15 ]

Nothing wrong here: the SQL generated by the ORM is correct, but your view definition is wrong: try running the select in console, manually.





[DDC-3542] [GH-1287] Typo fix Created: 25/Jan/15  Updated: 26/Jan/15  Resolved: 26/Jan/15

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

Type: Documentation Priority: Trivial
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: typo


 Description   

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

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

Message:



 Comments   
Comment by Doctrine Bot [ 26/Jan/15 ]

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

Comment by Doctrine Bot [ 26/Jan/15 ]

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





[DDC-3541] [GH-1286] Removing XDebug from non-coverage builds Created: 25/Jan/15  Updated: 25/Jan/15  Resolved: 25/Jan/15

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

Type: Improvement Priority: Minor
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: build-speed, ci, travis, xdebug


 Description   

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

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

Message:



 Comments   
Comment by Doctrine Bot [ 25/Jan/15 ]

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

Comment by Doctrine Bot [ 25/Jan/15 ]

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

Comment by Doctrine Bot [ 25/Jan/15 ]

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

Comment by Doctrine Bot [ 25/Jan/15 ]

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





[DDC-3540] [GH-1285] travis: remove unnecessary database creation Created: 25/Jan/15  Updated: 27/Jan/15  Resolved: 27/Jan/15

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

Type: Improvement Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Duplicate Votes: 0
Labels: ci, performance, setup, travis

Issue Links:
Duplicate
duplicates DDC-3546 [GH-1289] Improve test suite Resolved
Reference
relates to DDC-3532 [GH-1278] travis: remove unnecessary ... Resolved
is referenced by DDC-3546 [GH-1289] Improve test suite Resolved

 Description   

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

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

Message:

Ref: #1278



 Comments   
Comment by Doctrine Bot [ 25/Jan/15 ]

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

Comment by Doctrine Bot [ 25/Jan/15 ]

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

Comment by Doctrine Bot [ 27/Jan/15 ]

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





[DDC-3539] [GH-1284] #1189 DDC-3406 derived identity in proxy must be a proxy Created: 24/Jan/15  Updated: 25/Jan/15

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Dependency
is required for DDC-3406 Proxy returns string instead of object Open

 Description   

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

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

Message:

This is a horrible hack for #1189.

Not happy with it, this seems like it fixes just the symptom.



 Comments   
Comment by Doctrine Bot [ 24/Jan/15 ]

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

Comment by Doctrine Bot [ 24/Jan/15 ]

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

Comment by Doctrine Bot [ 24/Jan/15 ]

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

Comment by Doctrine Bot [ 25/Jan/15 ]

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

Comment by Doctrine Bot [ 25/Jan/15 ]

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





[DDC-3538] [GH-1283] #1267 - order by broken in pagination logic (reverts #1220) Created: 24/Jan/15  Updated: 24/Jan/15  Resolved: 24/Jan/15

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

Type: Bug Priority: Critical
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: limitsubqueryoutputwalker, orderBy, orderby, paginator, subquery

Issue Links:
Duplicate
is duplicated by DDC-3519 [GH-1267] Failing test for an ORDER B... Resolved

 Description   

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

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

Message:

This PR reverts #1220 and merges #1264



 Comments   
Comment by Doctrine Bot [ 24/Jan/15 ]

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

Comment by Doctrine Bot [ 24/Jan/15 ]

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





[DDC-3537] [GH-1282] Hotfix/#1169 extra lazy one to many should not delete referenced entities (backport to 2.4) Created: 24/Jan/15  Updated: 25/Jan/15  Resolved: 25/Jan/15

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: Lazy Loading, ORM
Affects Version/s: 2.4.7
Fix Version/s: 2.4.8
Security Level: All

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: delete, extra-lazy, onetomany, update

Issue Links:
Dependency
is required for DDC-3343 `PersistentCollection::removeElement`... Resolved

 Description   

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

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

Message:

See #1169

This PR backports #1281



 Comments   
Comment by Doctrine Bot [ 24/Jan/15 ]

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

Comment by Doctrine Bot [ 24/Jan/15 ]

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

Comment by Doctrine Bot [ 25/Jan/15 ]

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





[DDC-3536] [GH-1281] Hotfix/#1169 extra lazy one to many should not delete referenced entities Created: 24/Jan/15  Updated: 27/Jan/15  Resolved: 25/Jan/15

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: Lazy Loading, ORM
Affects Version/s: Git Master, 2.3.5, 2.4.7
Fix Version/s: 2.5
Security Level: All

Type: Bug Priority: Blocker
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: delete, extra-lazy, onetomany, update

Issue Links:
Dependency
depends on DDC-3544 [GH-1288] Hotfix - #1169 - extra lazy... Resolved
is required for DDC-3343 `PersistentCollection::removeElement`... Resolved

 Description   

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

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

Message:

This is an alternate fix for #1169 (DDC-3343 http://www.doctrine-project.org/jira/browse/DDC-3343)



 Comments   
Comment by Doctrine Bot [ 24/Jan/15 ]

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

Comment by Doctrine Bot [ 25/Jan/15 ]

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





[DDC-3535] Allow binding `Parameter` value object to statements, removing the need for explicit value and type passing Created: 24/Jan/15  Updated: 24/Jan/15

Status: Open
Project: Doctrine 2 - ORM
Component/s: Lazy Loading, ORM
Affects Version/s: None
Fix Version/s: None
Security Level: All

Type: Task Priority: Critical
Reporter: Marco Pivetta Assignee: Marco Pivetta
Resolution: Unresolved Votes: 0
Labels: binding, criteria, parameters, persister, repository, type


 Comments   
Comment by Marco Pivetta [ 24/Jan/15 ]

We currently have a lot of locations in the code where we use list($values, $types) = $this->computeParameters(); (pseudo-code).

This leads to a lot of code duplication and complexity.

Maybe a Parameter VO may be used instead, or a ParameterCollection with a fixed $types and a mutable $values, and with minimal internal validation.





[DDC-3534] [GH-1280] [DDC-3346] #1277 find one with eager loads is failing Created: 23/Jan/15  Updated: 25/Jan/15

Status: Open
Project: Doctrine 2 - ORM
Component/s: Lazy Loading, ORM
Affects Version/s: Git Master
Fix Version/s: 2.5
Security Level: All

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Unresolved Votes: 0
Labels: collection, eager, fetch, hydrator, lazy-loading, many-to-many, onetomany, persister

Issue Links:
Dependency
is required for DDC-3346 findOneBy returns an object with part... Resolved
is required for DDC-3531 [GH-1277] [DDC-3346] Failing test for... Resolved

 Description   

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

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

Message:

Ping @scaytrase

Note that this is a first revision and needs refactoring, so please consider helping out with that if you can.

Ping @guilhermeblanco: please check the `CachedPersisterContext` stuff: it's dirty as heck, but that's because the persister internal generated SQL caching is inconsistent as heck too.

Resolution path for 2.4.x will be to throw an exception if there is an offset or a limit.



 Comments   
Comment by Doctrine Bot [ 23/Jan/15 ]

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

Comment by Doctrine Bot [ 23/Jan/15 ]

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

Comment by Doctrine Bot [ 24/Jan/15 ]

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

Comment by Doctrine Bot [ 24/Jan/15 ]

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

Comment by Doctrine Bot [ 24/Jan/15 ]

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

Comment by Doctrine Bot [ 25/Jan/15 ]

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





[DDC-3533] [GH-1279] [Doc][Reference][2nd level cache] Created: 23/Jan/15  Updated: 23/Jan/15  Resolved: 23/Jan/15

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: Documentation, Second Level Cache
Affects Version/s: Git Master
Fix Version/s: 2.5
Security Level: All

Type: Documentation Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: documentation, rst, second-level-cache, typo


 Description   

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

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

Message:

  • Fixed typo in TimestampRegion title.
  • Normalized php snippets (comments, indentation).


 Comments   
Comment by Doctrine Bot [ 23/Jan/15 ]

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

Comment by Doctrine Bot [ 23/Jan/15 ]

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





[DDC-3532] [GH-1278] travis: remove unnecessary database creation Created: 22/Jan/15  Updated: 25/Jan/15  Resolved: 24/Jan/15

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

Type: Improvement Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Incomplete Votes: 0
Labels: ci, performance, setup, travis

Issue Links:
Reference
is referenced by DDC-3540 [GH-1285] travis: remove unnecessary ... Resolved

 Description   

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

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

Message:

Ref: https://github.com/doctrine/dbal/commit/a66010640cc03e73a60cee16f1da36daabd63898

https://github.com/doctrine/doctrine2/pull/1251#discussion_r23018406



 Comments   
Comment by Doctrine Bot [ 24/Jan/15 ]

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

Comment by Doctrine Bot [ 24/Jan/15 ]

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

Comment by Doctrine Bot [ 24/Jan/15 ]

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

Comment by Doctrine Bot [ 24/Jan/15 ]

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

Comment by Doctrine Bot [ 24/Jan/15 ]

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





[DDC-3531] [GH-1277] [DDC-3346] Failing test for issue (bad findOneBy behaviour with eager fetch) Created: 22/Jan/15  Updated: 25/Jan/15  Resolved: 23/Jan/15

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Duplicate Votes: 0
Labels: collection, eager, fetch, hydration, many-to-many, onetomany, persister

Issue Links:
Dependency
depends on DDC-3534 [GH-1280] [DDC-3346] #1277 find one w... Open
is required for DDC-3346 findOneBy returns an object with part... Resolved

 Description   

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

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

Message:

Here is the test for DDC-3346(http://www.doctrine-project.org/jira/browse/DDC-3346) issue



 Comments   
Comment by Doctrine Bot [ 23/Jan/15 ]

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

Comment by Doctrine Bot [ 23/Jan/15 ]

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

Comment by Doctrine Bot [ 24/Jan/15 ]

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

Comment by Doctrine Bot [ 24/Jan/15 ]

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

Comment by Doctrine Bot [ 24/Jan/15 ]

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

Comment by Doctrine Bot [ 25/Jan/15 ]

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





[DDC-3530] [GH-1276] travis: run coverage just once Created: 22/Jan/15  Updated: 22/Jan/15  Resolved: 22/Jan/15

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

Type: Improvement Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: build-speed, ci, coverage, travis


 Description   

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

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

Message:

Another speedup, just for 2.4 branch. Ref: https://github.com/doctrine/doctrine2/pull/1251

2.3 and bellow don't use coverage, so that should be all.



 Comments   
Comment by Doctrine Bot [ 22/Jan/15 ]

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

Comment by Doctrine Bot [ 22/Jan/15 ]

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





[DDC-3529] [GH-1275] [WIP] Nullable embedded objects. Created: 21/Jan/15  Updated: 24/Jan/15

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

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

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

Message:

The idea was to have a simple (and clean) way to override the nullable property of embedded objects, so I've
added the ```nullable``` attribute on the ```@Embedded``` annotation and it have 3 possible values:

  • NULL: The nullable option that was defined on the attributes of the embeddable class won't be overriden;
  • TRUE: All attributes of the embeddable class will be marked as nullable and the embeddable instance only would be created when data is not NULL;
  • FALSE: All attributes of the embeddable class will be marked as non-nullable.

There's a lot of things to be improved (mostly on UnitOfWork), but it's fully working with basic tests as you can see on ValueObjectsTest::testCRUDOfNullableEmbedded() case.

I would appreciate a lot your opinions!



 Comments   
Comment by Doctrine Bot [ 24/Jan/15 ]

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

Comment by Doctrine Bot [ 24/Jan/15 ]

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





[DDC-3528] [GH-1274] PersistentCollection now extends AbstractLazyCollection. Created: 21/Jan/15  Updated: 24/Jan/15

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Benjamin Eberlei
Resolution: Unresolved 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/1274

Message:



 Comments   
Comment by Doctrine Bot [ 22/Jan/15 ]

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

Comment by Doctrine Bot [ 24/Jan/15 ]

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

Comment by Doctrine Bot [ 24/Jan/15 ]

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





[DDC-3527] Provide a method to retrieve exactly one entity out of entity repository Created: 20/Jan/15  Updated: 22/Jan/15

Status: Open
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: Git Master
Fix Version/s: 3.0

Type: Improvement Priority: Minor
Reporter: Dominik D Assignee: Marco Pivetta
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Hello,

currently we have EntityRepository::findOneBy() method for retrieving a single or none entities out of an EntityRepository. It would be very useful, if there was a method which retrieves exactly one entity or throws NonUniqueResultException in case of multiple records returned or NoResultException in case of zero results returned (just like Query::getSingleResult() currently does).

Very often I find myself creating custom repositories for a couple of ::findOneByOrThrow() methods only. Needless to say it's quite mundane to do. The bodies of such methods follows the same pattern:

1. Query the EntityRepository using EntityRepository::findOneBy().
2. If the result is null, then throw an Exception.
3. Return the result.

It'd be very nice to have it out-of-the-box in the base EntityRepository.

Thanks.



 Comments   
Comment by Marco Pivetta [ 20/Jan/15 ]

We actually want to reduce the repository API, not expand it...

Comment by Dominik D [ 21/Jan/15 ]

Wow, ok. I guess you've got good reasons for it and I shouldn't try to convince you, that having methods for most common use cases out of the box is quite convenient?

If yes, then fine. I can create a common EntityRepository subclass for myself and put any helper methods I want there. This would at least cut down on the code duplication in my codebase.

If what you say is final, then we can close this ticket.

Cheers.

Comment by Marco Pivetta [ 22/Jan/15 ]

I guess you've got good reasons for it and I shouldn't try to convince you, that having methods for most common use cases out of the box is quite convenient?

The main problem is that adding API methods to repositories forces any subclasses to also apply eventual filtering logic to those as well.

Other than that, it's merely a question of interface segregation: the current API is hardly maintainable if we assume that many developers subclassed the EntityRepository class, therefore we should keep it locked until 3.x.

I'll actually mark this issue for 3.0 and defer discussion till then.

Comment by Dominik D [ 22/Jan/15 ]

Ok, thanks.





[DDC-3526] [GH-1273] Incorrect @throws doc. in getSingleScalarResult Created: 20/Jan/15  Updated: 20/Jan/15  Resolved: 20/Jan/15

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

Type: Documentation Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: docblock, query


 Description   

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

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

Message:

This method doesn't throw QueryException.

The documentation should says that it throws: "NoResultException" or "NonUniqueResultException"



 Comments   
Comment by Doctrine Bot [ 20/Jan/15 ]

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

Comment by Doctrine Bot [ 20/Jan/15 ]

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





[DDC-3525] Exception "The column id must be mapped to a field in class" when associationKey used Created: 20/Jan/15  Updated: 21/Jan/15

Status: Awaiting Feedback
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.4.7
Fix Version/s: None
Security Level: All

Type: Bug Priority: Major
Reporter: Ilya Antipenko Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: associationKey, foreign-key

Attachments: Text File foreign-key.log    

 Description   

I have issue when I use "associationKey"

I create test repo for reproduce this issue:
https://github.com/aivus/symfony2-foreign-bug

1. composer install
2. Set DB parameters in app/config/parameters.yml and create DB
3. php app/console doctrine:schema:create --force
4. php app/console server:run
5. Load fixtures: http://127.0.0.1:8000/app/loadFixture
6. Try to get list: http://127.0.0.1:8000/app_dev.php/admin/app/app/order/list

I make workaround, which works for me (https://github.com/aivus/doctrine2/commit/8461111e8aea98d02175f3642870a689d446beef), but I'm not sure about it



 Comments   
Comment by Ilya Antipenko [ 21/Jan/15 ]

Add stacktrace





[DDC-3524] [GH-1272] [DDC-2704] - merge inherited transient properties - merge properties into uninitialized proxies Created: 20/Jan/15  Updated: 25/Jan/15  Resolved: 25/Jan/15

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: inheritance, merge, private-properties, transient-properties, unitofwork

Issue Links:
Dependency
is required for DDC-2704 When using Discriminator EntityManage... Resolved

 Description   

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

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

Message:

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



 Comments   
Comment by Doctrine Bot [ 24/Jan/15 ]

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

Comment by Doctrine Bot [ 25/Jan/15 ]

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





[DDC-3523] [GH-1271] Update migration_2_5.rst Created: 20/Jan/15  Updated: 20/Jan/15  Resolved: 20/Jan/15

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

Type: Documentation Priority: Minor
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: upgrade-notes


 Description   

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

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

Message:

Fixed some formatting issues and typos.






[DDC-3522] [GH-1270] Update composer on travis build. Created: 20/Jan/15  Updated: 20/Jan/15  Resolved: 20/Jan/15

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

Type: Improvement Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Duplicate
duplicates DDC-3521 [GH-1269] [DDC-3520] self-update comp... Resolved

 Description   

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

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

Message:



 Comments   
Comment by Doctrine Bot [ 20/Jan/15 ]

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





[DDC-3521] [GH-1269] [DDC-3520] self-update composer before install Created: 20/Jan/15  Updated: 20/Jan/15  Resolved: 20/Jan/15

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

Type: Improvement Priority: Major
Reporter: Doctrine Bot Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: composer, travis

Issue Links:
Duplicate
is duplicated by DDC-3522 [GH-1270] Update composer on travis b... Resolved

 Description   

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

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

Message:

Updating composer before install seems like a good idea. At the moment for example the travis build is failing because of the new composer syntax with '^' and it would be fixed by composer self-update.

Sorry for the spam, opened the pull request against master this time.



 Comments   
Comment by Doctrine Bot [ 20/Jan/15 ]

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





[DDC-3520] [GH-1268] Update composer before install Created: 20/Jan/15  Updated: 20/Jan/15  Resolved: 20/Jan/15

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

Type: Improvement Priority: Minor
Reporter: Doctrine Bot Assignee: Steve Müller
Resolution: Incomplete Votes: 0
Labels: composer, self-update, tests, travis


 Description   

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

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

Message:

Updating composer before install seems like a good idea. At the moment for example the travis build is failing because of the new composer syntax with '^' and it would be fixed by composer self-update.



 Comments   
Comment by Doctrine Bot [ 20/Jan/15 ]

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





[DDC-3519] [GH-1267] Failing test for an ORDER BY that is INNER JOINed in a subquery Created: 19/Jan/15  Updated: 24/Jan/15  Resolved: 24/Jan/15

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

Type: Bug Priority: Critical
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Duplicate Votes: 0
Labels: limit, limitsubqueryoutputwalker, orderBy, orderby, paginator, subquery

Issue Links:
Duplicate
duplicates DDC-3538 [GH-1283] #1267 - order by broken in ... Resolved

 Description   

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

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

Message:

A failing test case to demonstrate a problem with #1220.

cc: @Ocramius @zeroedin-bill, @mvrhov, @stof, @brianium, @mrkrstphr



 Comments   
Comment by Doctrine Bot [ 24/Jan/15 ]

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

Comment by Doctrine Bot [ 24/Jan/15 ]

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

Comment by Doctrine Bot [ 24/Jan/15 ]

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





[DDC-3518] [GH-1266] [2.4] Fix schema generation in the test suite Created: 18/Jan/15  Updated: 22/Jan/15  Resolved: 22/Jan/15

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: ci, testsuite, travis


 Description   

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

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

Message:

This PR backports doctrine/doctrine2@b314476599954086f1eaa43800901b9d817df257 into 2.4



 Comments   
Comment by Doctrine Bot [ 18/Jan/15 ]

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

Comment by Doctrine Bot [ 22/Jan/15 ]

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





[DDC-3517] [GH-1265] Fix error undefined index "targetEntity" in persister Created: 18/Jan/15  Updated: 28/Jan/15  Resolved: 18/Jan/15

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: inheritance, one-to, onetoone, persister, sti


 Description   

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

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

Message:



 Comments   
Comment by Doctrine Bot [ 18/Jan/15 ]

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

Comment by Doctrine Bot [ 18/Jan/15 ]

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





[DDC-3516] [GH-1264] Add Changelog/Migration to 2.5 documentation chapter. Created: 18/Jan/15  Updated: 20/Jan/15  Resolved: 20/Jan/15

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

Type: Documentation Priority: Critical
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: documentation, upgrade-notes


 Description   

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

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

Message:

new chapter in documentation for migrating to 2.5. Includes a changelog of new features and improvements as well as BC breaks from UPGRADE.md



 Comments   
Comment by Doctrine Bot [ 20/Jan/15 ]

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

Comment by Doctrine Bot [ 20/Jan/15 ]

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





[DDC-3515] [GH-1263] #1223 DDC-3453 - make `EntityManager` constructor `public` Created: 18/Jan/15  Updated: 24/Jan/15

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

Type: Improvement Priority: Major
Reporter: Doctrine Bot Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: constructor, entitymanager, setup

Issue Links:
Reference
is referenced by DDC-3453 [GH-1223] Refactored construction of ... Resolved

 Description   

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

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

Message:



 Comments   
Comment by Doctrine Bot [ 18/Jan/15 ]

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

Comment by Doctrine Bot [ 18/Jan/15 ]

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

Comment by Doctrine Bot [ 18/Jan/15 ]

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

Comment by Doctrine Bot [ 24/Jan/15 ]

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





[DDC-3514] LimitSubqueryOutputWalker should not duplicate orderBy clauses Created: 17/Jan/15  Updated: 17/Jan/15  Resolved: 17/Jan/15

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

Type: Improvement Priority: Major
Reporter: Marco Pivetta Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: limitsubqueryoutputwalker, orderBy, orderby, paginator, performance, subquery


 Description   

This issue is just tracking https://github.com/doctrine/doctrine2/pull/1220






[DDC-3513] [GH-1262] Fixes the broken DQL command Created: 17/Jan/15  Updated: 17/Jan/15  Resolved: 17/Jan/15

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: console, debug, dql, dump, sql

Issue Links:
Reference
relates to DDC-3462 [GH-1230] Allow dumping SQL query whe... Resolved

 Description   

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

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

Message:

Now it can again output more than only the created SQL query.
See https://github.com/doctrine/doctrine2/commit/cdb62a70cd0baac8357a42bbe42cacdb6784d2aa#comments



 Comments   
Comment by Doctrine Bot [ 17/Jan/15 ]

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

Comment by Doctrine Bot [ 17/Jan/15 ]

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





[DDC-3512] Redesign ClassMetadata API as ValueObject based (for type-safety and self-documentation) Created: 17/Jan/15  Updated: 18/Jan/15

Status: Open
Project: Doctrine 2 - ORM
Component/s: Mapping Drivers, ORM
Affects Version/s: None
Fix Version/s: 3.0
Security Level: All

Type: Improvement Priority: Critical
Reporter: Marco Pivetta Assignee: Marco Pivetta
Resolution: Unresolved Votes: 0
Labels: classmetadatafactory, cleanup, metadata, performance, type-safety

Issue Links:
Reference
relates to DDC-3503 [GH-1257] Resolve target entity also ... Resolved

 Description   

The current ClassMetadata API is based on a lot of array juggling (for performance reasons).

While that was understandable with PHP 5.3, all the array access operations are currently:

  • slowing things down
  • making the code very hard to read/understand

I suggest re-coding the ClassMetadata internals (public properties and such) so that well-described properties are defined.

Additionally, as a bonus, we'd get a performance boost by just moving all the class-alias and type resolution logic from the runtime into the ClassMetadataFactory (or similar) API, saving tons of performance at every run.

In pseudo-logic, what I'd like to achieve with DDC-3512 is:

  • base metadata is loaded from the mapping driver
  • onLoadMetadata event is fired for each loaded metadata instance
  • metadata is completed by the ClassMetadataFactory logic
  • onCompleteMetadata event is fired for each loaded metadata instance

This would make metadata manipulation from events a bit messier (user needs to know which value to change during which event), but would allow using better constrained metadata structures in future, and that would disallow mistakes during event listeners execution as well (internal validation).






[DDC-3511] Temporarily change fetch mode in DQL for toMany relations Created: 16/Jan/15  Updated: 16/Jan/15

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

Type: New Feature Priority: Major
Reporter: Filip Procházka Assignee: Guilherme Blanco
Resolution: Unresolved Votes: 0
Labels: dql, eager, fetch-mode, query


 Description   

This would be a major improvement. I can't seem to find the issue for this. Is this even planned?

http://docs.doctrine-project.org/en/latest/reference/dql-doctrine-query-language.html#temporarily-change-fetch-mode-in-dql

I might be able to find some time to work on this in February, if nobody else is going to.



 Comments   
Comment by Marco Pivetta [ 16/Jan/15 ]

You might want to wait for the persisters to stabilize with 2.5





[DDC-3510] [GH-1261] Add a new QuoteStrategy that automatically escape database reserved keyword Created: 16/Jan/15  Updated: 24/Jan/15

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

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

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

Message:

All the upload screenshots which are used to explain what we are doing are taken from a real project developed with Mouf dependency injection framework (http://mouf-php.com/) that we use to configure the entity manager.

We wanted to create a FAQ where admin can add question/answer and use drag and drop to set the position of the question in the FAQ.

For this, at some point, in an entity, we used a protected keyword "order" in a class FAQ:

```
/**

  • @ORM\Column(type="integer", nullable=false)
  • @var int
    */
    private $order;
    ```

This fails with Doctrine. The documentation clearly explains why: http://doctrine-orm.readthedocs.org/en/latest/reference/basic-mapping.html#quoting-reserved-words

Below are a list of screenshot explaining we use the `DefaultQuoteStrategy` and the failure message we get.

![doctrineconfiguration](https://cloud.githubusercontent.com/assets/8350192/5779969/4ab5c15e-9da7-11e4-8df8-f2c718c8d66a.PNG)

In the configuration,the "quoteStrategy" setter is not set. Therefore, we use `DefaultQuoteStrategy`.

![defaultquotestrategy](https://cloud.githubusercontent.com/assets/8350192/5779977/51fe0a70-9da7-11e4-9cfa-3a86e6f8aab8.PNG)

We get this error:

![error](https://cloud.githubusercontent.com/assets/8350192/5779963/422e0bc2-9da7-11e4-902c-602a2eac7f96.PNG)
We get an error while using doctrine ORM because it doesn't auto escape protected keyword. (We can protect it manually by using ` .)

We created a new QuoteStratigy that automaticcaly escape protected keyword *only*. We just bind it via the Mouf interface:

![escapingquotestrategy](https://cloud.githubusercontent.com/assets/8350192/5780067/d9997bae-9da7-11e4-8a23-c5fa2ebaffcc.PNG)

and then the magic begins: a screenshot of the page with no error.

![succes](https://cloud.githubusercontent.com/assets/8350192/5780085/f9b597f6-9da7-11e4-85b0-cd09fb572cd9.PNG)

We would like to submit this new `EscapingQuoteStrategy` as we think it will be easier for developers to work with it, and it should not have a big performance impact (only an additional lookup in a table)



 Comments   
Comment by Doctrine Bot [ 24/Jan/15 ]

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

Comment by Doctrine Bot [ 24/Jan/15 ]

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





[DDC-3509] Mapping exclusion Created: 16/Jan/15  Updated: 16/Jan/15  Resolved: 16/Jan/15

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

Type: Improvement Priority: Minor
Reporter: Grégoire Paris Assignee: Marco Pivetta
Resolution: Invalid Votes: 0
Labels: directory, file-estension, file-locator, filesystem, yaml


 Description   

Using the yaml driver, are there any methods to exclude some mapping files? I have a library with all mappings in a directory and would like to read only some of these mappings. How can I do that ? I am under the impression that you can manage things on a per-directory basis only, not on a per-file basis.



 Comments   
Comment by Marco Pivetta [ 16/Jan/15 ]

You can pass a custom file locator to your Yaml mapping driver:

https://github.com/doctrine/common/blob/b44549dcc98a18f0728df05df523bdf179edb90b/lib/Doctrine/Common/Persistence/Mapping/Driver/FileDriver.php#L64

That would allow you to define how files are found, and where.





[DDC-3508] andWhere('... OR...') syntax ignores a newly added field Created: 16/Jan/15  Updated: 23/Jan/15  Resolved: 23/Jan/15

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

Type: Bug Priority: Major
Reporter: Julien Villetorte Assignee: Guilherme Blanco
Resolution: Invalid Votes: 0
Labels: dql, querybuilder
Environment:

CentOS



 Description   

Doctrine v2.3.6

All caches cleared before reporting.

After adding a new field on an already existing entity (field "question" on a "News" entity), this field is ignored when using the addWhere('.... OR ...') syntax, while it's working using a $qb->expr()->orX() syntax:

Not working (missing "question" column in SELECT of the generated SQL, and objects hydrated with a question's value of null) :

$qb = $this->createQueryBuilder('n');

$qb
    ->where('n.state = :state')
    ->andWhere('n.startAt <= :now')
    ->andWhere('n.endAt >= :now OR n.endAt is NULL') // Ignores the question field, don't know why
    ->setParameter('state', News::ACTIVE)
    ->setParameter('now', new \DateTime())
    ->orderBy('n.createdAt', 'DESC');

This syntax works:

$qb = $this->createQueryBuilder('n');

$qb
    ->where('n.state = :state')
    ->andWhere('n.startAt <= :now')
    ->andWhere($qb->expr()->orX(
        $qb->expr()->gte('n.endAt', ':now'),
        $qb->expr()->isNull('n.endAt')
    ))
    ->setParameter('state', News::ACTIVE)
    ->setParameter('now', new \DateTime())
    ->orderBy('n.createdAt', 'DESC');

Notes:

  • If I add an extra ->addSelect('n.question'), the field shows up twice in the generated SQL.
  • If I remove the orderBy statement or the "OR n.endAt is NULL" part, the field shows up in the SQL.
  • The generated DQL of both queries is exactly the same:
    SELECT n FROM [...]\Entity\News n WHERE n.state = :state AND n.startAt <= :now AND (n.endAt >= :now OR n.endAt IS NULL) ORDER BY n.createdAt DESC
    


 Comments   
Comment by Marco Pivetta [ 23/Jan/15 ]

Julien Villetorte why was this marked as invalid? Was it already fixed in 2.4?





[DDC-3507] [GH-1260] Added PersisterFactory to ORM. Created: 16/Jan/15  Updated: 24/Jan/15

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Benjamin Eberlei
Resolution: Unresolved 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/1260

Message:



 Comments   
Comment by Doctrine Bot [ 24/Jan/15 ]

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

Comment by Doctrine Bot [ 24/Jan/15 ]

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





[DDC-3506] [GH-1259] Hotfix: Cache region should not mutate injected cache instance settings Created: 15/Jan/15  Updated: 15/Jan/15  Resolved: 15/Jan/15

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: cache, cache-namespace, cache-region, factory


 Description   

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

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

Message:

This is strictly related to https://github.com/doctrine/cache/pull/48#discussion_r19059174 as well



 Comments   
Comment by Doctrine Bot [ 15/Jan/15 ]

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

Comment by Doctrine Bot [ 15/Jan/15 ]

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





[DDC-3505] Apache starts eating up full CPU Created: 15/Jan/15  Updated: 15/Jan/15  Resolved: 15/Jan/15

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

Type: Improvement Priority: Major
Reporter: Jaskaran Singh Assignee: Marco Pivetta
Resolution: Invalid Votes: 0
Labels: doctrine2, php-5.4, zendframework
Environment:

PHP 5.4 + Windows server + doctrine2 + ZF1 + Apache2.4.4



 Description   

I have been using Doctrine2.3.2 in combination with Zend-Framework1.

This PHP ORM is the best ORM I have ever used. Using this for last 2 years but suddenly my project started giving me problem.
The server on which I have hosted the project is Apache2.4.4 and randomly it stops responding after few days and sometime 2 times a day.
When I check the server it shows that apache is still running but eating full CPU. The problem temporarily solves when I restart apache.

I wonder if I have misconfigured doctrine or if there are special configuration settings for production environment.

The DB server we are using is MS SQL server 2012.

You can see my project http://phpdemo.seasiainfotech.com:9040/ilook/qa/
User : jsingh7@seasiaconsulting.com
Password : mind@123

Let me know if more information is required.



 Comments   
Comment by Marco Pivetta [ 15/Jan/15 ]

We can't log into your running system and analyze the issue for you: you have to debug and find the problem yourself.

Closing.





[DDC-3504] [GH-1258] Classify persisters into more granular namespaces. Created: 15/Jan/15  Updated: 15/Jan/15  Resolved: 15/Jan/15

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

Type: Improvement Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: persister, refactoring


 Description   

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

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

Message:



 Comments   
Comment by Doctrine Bot [ 15/Jan/15 ]

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

Comment by Doctrine Bot [ 15/Jan/15 ]

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





[DDC-3503] [GH-1257] Resolve target entity also in discriminator map (allows interfaces and custom names in discriminator map) Created: 15/Jan/15  Updated: 22/Jan/15  Resolved: 22/Jan/15

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

Type: New Feature Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: discriminator-map, inheritance, metadata, resolve-target-entities

Issue Links:
Dependency
is required for DDC-3300 [GH-1130] [WIP] Added resolve entitie... Resolved
Reference
is referenced by DDC-3512 Redesign ClassMetadata API as ValueOb... Open

 Description   

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

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

Message:

This PR supersedes #1130 (DDC-3300(http://www.doctrine-project.org/jira/browse/DDC-3300)).

The final aim of the PR is to be able to define following in discriminator maps:

```php
/** @DiscriminatorMap(

{"foo" = "FooInterface", "bar" = "BarConcreteImpl"}

) */
```



 Comments   
Comment by Doctrine Bot [ 15/Jan/15 ]

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

Comment by Doctrine Bot [ 16/Jan/15 ]

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

Comment by Doctrine Bot [ 16/Jan/15 ]

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

Comment by Doctrine Bot [ 22/Jan/15 ]

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





[DDC-3502] [GH-1256] DDC-3493 - fixed EntityGenerator parsing for php 5.5 "::class" syntax Created: 15/Jan/15  Updated: 15/Jan/15  Resolved: 15/Jan/15

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: class, entityGenerator, php-5.5, php-parsing

Issue Links:
Dependency
is required for DDC-3493 New (PHP 5.5) "class" keyword - wrong... Resolved
is required for DDC-3494 [GH-1250] Test case for "class" keyword Resolved

 Description   

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

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

Message:

I did not check for $i > 0 because at least a php opening tag is needed for the src to be valid PHP, so the class tag can never be at index 0. Please let me know if you think I should add that check.



 Comments   
Comment by Doctrine Bot [ 15/Jan/15 ]

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

Comment by Doctrine Bot [ 15/Jan/15 ]

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

Comment by Doctrine Bot [ 15/Jan/15 ]

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

Comment by Doctrine Bot [ 15/Jan/15 ]

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





[DDC-3501] [GH-1255] Cleanup: PHP 5.3 support end Created: 14/Jan/15  Updated: 15/Jan/15  Resolved: 15/Jan/15

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

Type: Improvement Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: cleanup, php-5.3, php-5.4


 Description   

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

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

Message:



 Comments   
Comment by Doctrine Bot [ 15/Jan/15 ]

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

Comment by Doctrine Bot [ 15/Jan/15 ]

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





[DDC-3500] [GH-1254] Fix applying ON/WITH conditions to first join in Class Table Inheritance Created: 14/Jan/15  Updated: 17/Jan/15  Resolved: 17/Jan/15

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: dql, inheritance, join, jti, leftjoin, sql-walker

Issue Links:
Reference
relates to DDC-2506 WITH Conditionals on Class Table Inhe... Resolved
relates to DDC-349 Add support for specifying precedence... Open

 Description   

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

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

Message:

Now we build nested joins for CTI when using ON/WITH clause.



 Comments   
Comment by Doctrine Bot [ 17/Jan/15 ]

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

Comment by Doctrine Bot [ 17/Jan/15 ]

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





[DDC-3499] [GH-1253] Fix dead link Created: 14/Jan/15  Updated: 14/Jan/15  Resolved: 14/Jan/15

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

Type: Documentation Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: documentation, link, rst


 Description   

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

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

Message:

on this page: http://docs.doctrine-project.org/en/latest/reference/advanced-configuration.html#connection-options



 Comments   
Comment by Doctrine Bot [ 14/Jan/15 ]

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

Comment by Doctrine Bot [ 14/Jan/15 ]

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





[DDC-3498] orphanRemoval=true for One-To-Many Bidirectional associations (without Join Table) produces unnecessary number of DELETE queries Created: 14/Jan/15  Updated: 14/Jan/15

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

Type: Improvement Priority: Minor
Reporter: Alex Prokop Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: mapping, onetomany, orm, orphanRemoval
Environment:

PHP 5.5.11
MySQL 5.6.16 Source distribution


Attachments: File example.php    
Issue Links:
Reference
is referenced by DDC-3497 orphanRemoval=true overrides onDelete... Open

 Description   

If orphanRemoval=true is set on a One-To-Many Bidirectional association without a Join Table, when removing the owning entity, multiple DELETE queries are generated. Since the row in the database on the Many-To-One side contains both the association and entity data, it should be possible to replace this with a single DELETE query using the owning entity's id, as when deleting associations in a Join Table for a Many-To-Many association. See attachment for example code.






[DDC-3497] orphanRemoval=true overrides onDelete="CASCADE" behaviour for One-To-Many Bidirectional associations (without Join Table) Created: 14/Jan/15  Updated: 14/Jan/15

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

Type: Improvement Priority: Minor
Reporter: Alex Prokop Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: cascade, mapping, ondelete, onetomany, orm, orphanRemoval
Environment:

PHP 5.5.11
MySQL 5.6.16 Source distribution


Attachments: File example.php    
Issue Links:
Reference
relates to DDC-3498 orphanRemoval=true for One-To-Many Bi... Open

 Description   

When removing entities from a collection, only the association is removed not the entity itself. But for One-To-Many Bidirectional associations without a Join Table, the database row on the Many-To-One side contains the information for both the association and the entity data. If when removing the association the desired behaviour is to delete the entity as well then orphanRemoval=true can be used on the One-To-Many annotation. However this overrides onDelete="CASCADE" if set on the JoinColumn of the Many-To-One side, resulting in unnecessary DELETE queries. Additionally, these queries are run separately for each entity in the collection, rather than as a single query as with Many-To-Many Join Tables (see linked issue). See example code attached.



 Comments   
Comment by Alex Prokop [ 14/Jan/15 ]

Both issues relate to One-To-Many associations without Join Tables, where the data row on the Many-To-One side is both association and entity data.





[DDC-3496] [GH-1252] Include className in calls to NamingStrategy joinColumnName method Created: 14/Jan/15  Updated: 17/Jan/15  Resolved: 17/Jan/15

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

Type: Improvement Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: naming-strategy


 Description   

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

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

Message:

For consistency with `propertyToColumnName`, include the class name when generating names for join columns as well, for instances where you want to name columns (inc. join columns) based on the class that defined them.



 Comments   
Comment by Doctrine Bot [ 17/Jan/15 ]

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

Comment by Doctrine Bot [ 17/Jan/15 ]

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





[DDC-3495] [GH-1251] travis: optimize to run coverage only once Created: 14/Jan/15  Updated: 15/Jan/15  Resolved: 15/Jan/15

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

Type: Improvement Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: build-speed, coverage, travis


 Description   

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

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

Message:



 Comments   
Comment by Doctrine Bot [ 15/Jan/15 ]

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

Comment by Doctrine Bot [ 15/Jan/15 ]

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





[DDC-3494] [GH-1250] Test case for "class" keyword Created: 14/Jan/15  Updated: 15/Jan/15  Resolved: 15/Jan/15

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: class, entityGenerator, php-5.5, php-parsing

Issue Links:
Dependency
depends on DDC-3502 [GH-1256] DDC-3493 - fixed EntityGene... Resolved
is required for DDC-3493 New (PHP 5.5) "class" keyword - wrong... Resolved

 Description   

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

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

Message:

Test case for http://www.doctrine-project.org/jira/browse/DDC-3493



 Comments   
Comment by Doctrine Bot [ 15/Jan/15 ]

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

Comment by Doctrine Bot [ 15/Jan/15 ]

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

Comment by Doctrine Bot [ 15/Jan/15 ]

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

Comment by Doctrine Bot [ 15/Jan/15 ]

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

Comment by Marco Pivetta [ 15/Jan/15 ]

Resolved in DDC-3502





[DDC-3493] New (PHP 5.5) "class" keyword - wrong parsing by EntityGenerator Created: 14/Jan/15  Updated: 15/Jan/15  Resolved: 15/Jan/15

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM, Tools
Affects Version/s: 2.4.7
Fix Version/s: 2.5, 2.4.8
Security Level: All

Type: Bug Priority: Major
Reporter: Lukasz Mazur Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: class, entityGenerator, php-5.5, php-parsing
Environment:

Windows
Apache 2.4.9
PHP Version 5.5.12
Symfony 2.5.9


Issue Links:
Dependency
depends on DDC-3494 [GH-1250] Test case for "class" keyword Resolved
depends on DDC-3502 [GH-1256] DDC-3493 - fixed EntityGene... Resolved

 Description   

Doctrine command "generate:entitites" is returning Notice Error:
Notice: Uninitialized string offset: 1 in \vendor\doctrine\orm\lib\Doctrine\ORM\Tools\EntityGenerator.php line 674

When trying to use this command on class containing function which is using introduced in 5.5 syntax ClassName::class.

Even simple:
public static function getClass()

{ return self::class; }

is generating a problem.



 Comments   
Comment by Marco Pivetta [ 14/Jan/15 ]

Lukasz Mazur can you come up with a test case to be added to doctrine/common?

See https://github.com/doctrine/common/blob/b44549dcc98a18f0728df05df523bdf179edb90b/tests/Doctrine/Tests/Common/Proxy/ProxyClassGeneratorTest.php as a reference for that.

Comment by Marco Pivetta [ 14/Jan/15 ]

Ah, my mistake: this is about the entity generator. See https://github.com/doctrine/doctrine2/blob/9c3cb579313ae01cdd3467b9f89fc15e9677b46c/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php instead.

Comment by Lukasz Mazur [ 14/Jan/15 ]

Marco Pivetta to be honest this stuff is still new for me - I am learning Symfony2&Doctrine and wanted to report this issue - to help somehow I do not fully understand whats going on in those test cases :/

Comment by Marco Pivetta [ 14/Jan/15 ]

Lukasz Mazur we're all pretty much in a rush to get 2.5 out, so please consider hopping in IRC and I should help you setting up the test suite.

irc.freenode.net, channel #doctrine-dev, poke "Ocramius" there

Comment by Andrea Sprega [ 14/Jan/15 ]

I'd like to take care of the issue if not yet assigned.

Comment by Marco Pivetta [ 15/Jan/15 ]

Handled in DDC-3502





[DDC-3492] [GH-1249] Support for extra lazy get for both owning and inverse side on many to many associations. Created: 13/Jan/15  Updated: 15/Jan/15  Resolved: 15/Jan/15

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

Type: Improvement Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: collection, extra-lazy, many-to-many

Issue Links:
Duplicate
is duplicated by DDC-2535 [GH-712] Extra lazy get for inverse s... Resolved

 Description   

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

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

Message:

Addresses #710 and #712



 Comments   
Comment by Doctrine Bot [ 15/Jan/15 ]

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

Comment by Doctrine Bot [ 15/Jan/15 ]

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





[DDC-3491] Annotation for column value case sensitivity Created: 13/Jan/15  Updated: 13/Jan/15

Status: Open
Project: Doctrine 2 - ORM
Component/s: Mapping Drivers, Tools
Affects Version/s: None
Fix Version/s: None
Security Level: All

Type: Improvement Priority: Minor
Reporter: Zoltán Halassy Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

It would be cool, if CHAR/VARCHAR case-sensitivity could be annotated on a column.

Every database driver would pick two default (config-overridable) collation, one for case-sensitive, and one for case-insensitive, and use those when the user requests or case-sensitive or insensitive column definition. This way the annotation would be portable.






[DDC-3490] [GH-1248] improved error handling for invalid association values #2 Created: 13/Jan/15  Updated: 18/Jan/15  Resolved: 18/Jan/15

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

Type: Improvement Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: association, changeset, exception-message, exceptions, invalid-state, mapping

Issue Links:
Reference
relates to DDC-3098 [GH-1016] improved error handling for... Resolved

 Description   

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

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

Message:

Possibly to do:
1. Make custom Exception for line 713
2. Make custom Exception for line 817
3. Does the object check on line 816 slow down the code too much? Alternatively a try-catch could be put around line 1415 or higher up.

Previous: https://github.com/doctrine/doctrine2/pull/1016



 Comments   
Comment by Doctrine Bot [ 17/Jan/15 ]

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

Comment by Doctrine Bot [ 18/Jan/15 ]

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





[DDC-3489] Sequence generators should be stateless Created: 13/Jan/15  Updated: 13/Jan/15

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

Type: Bug Priority: Major
Reporter: Marco Pivetta Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: metadata, sequence, sequence-generator, stateless

Issue Links:
Dependency
is required for DDC-2477 [GH-681] Sequence generator fix Resolved

 Description   

Current sequence generators keep internal state such as the metadata of the entity that uses the sequence.

The sequence generators should instead be stateless.






[DDC-3488] [GH-1247] Add a Gitter chat badge to README.md Created: 12/Jan/15  Updated: 12/Jan/15  Resolved: 12/Jan/15

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

Type: Documentation Priority: Trivial
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Won't Fix Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of gitter-badger:

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

Message:

      1. doctrine/doctrine2 now has a Chat Room on Gitter

@Ocramius has just created a chat room. You can visit it here: https://gitter.im/doctrine/doctrine2(https://gitter.im/doctrine/doctrine2?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&content=body_link).

This pull-request adds this badge to your README.md:

[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/doctrine/doctrine2?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=body_badge)

Happy chatting.

PS: [Click here](https://gitter.im/settings/badger/opt-out) if you would prefer not to receive automatic pull-requests from Gitter in future.



 Comments   
Comment by Doctrine Bot [ 12/Jan/15 ]

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

Comment by Doctrine Bot [ 12/Jan/15 ]

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





[DDC-3487] [GH-1246] [WIP] Moved delete() and update() to proper locations. Created: 12/Jan/15  Updated: 13/Jan/15  Resolved: 13/Jan/15

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

Type: Improvement Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: collection, criteria, persister, refactoring


 Description   

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

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

Message:



 Comments   
Comment by Doctrine Bot [ 13/Jan/15 ]

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

Comment by Doctrine Bot [ 13/Jan/15 ]

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





[DDC-3486] [GH-1245] Implemented support for one to many extra lazy with joined inheritance. Created: 12/Jan/15  Updated: 12/Jan/15  Resolved: 12/Jan/15

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

Type: Improvement Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: extra-lazy, jti, onetomany

Issue Links:
Dependency
is required for DDC-2504 [GH-696] extra lazy joined test Resolved

 Description   

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

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

Message:



 Comments   
Comment by Doctrine Bot [ 12/Jan/15 ]

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

Comment by Doctrine Bot [ 12/Jan/15 ]

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





[DDC-3485] Using Embeddable in MappedSuperclass fails Created: 11/Jan/15  Updated: 11/Jan/15

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

Type: Bug Priority: Major
Reporter: Marco Pfeiffer Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None

Attachments: File EmbedInMappedSuperclass.php    

 Description   

While Trying to Embed an object into a mapped superclass an exception is thrown:

PHP Fatal error:  Uncaught exception 'Doctrine\ORM\Mapping\MappingException' with message 'Duplicate definition of column 'embed_someField' on entity 'Entity' in a field or discriminator column mapping.' in /home/dev/Workspace/symfony/perto/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/MappingException.php:555





[DDC-3484] [GH-1244] Change $this return type to static in AbstractQuery Created: 11/Jan/15  Updated: 11/Jan/15  Resolved: 11/Jan/15

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

Type: Documentation Priority: Minor
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: docblock, fluent, query, return-type


 Description   

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

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

Message:

This allows IDEs and static code analysis tools to properly understand the return type when chaining methods, for example when using the QueryBuilder:

$query = $this->em->createQueryBuilder()
->select('u')
->from(User::class, 'u')
->where('u.email = :email')
->getQuery()
->setParameter('email', $email)
->setMaxResults(10);

In this example, my IDE (PHPStorm) reports:

> Method 'setMaxResults' not found in class \Doctrine\ORM\AbstractQuery

With a `static` return type, the IDE now understands the chaining and knows that `$query` is a `Query`, not just an `AbstractQuery`.



 Comments   
Comment by Doctrine Bot [ 11/Jan/15 ]

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

Comment by Doctrine Bot [ 11/Jan/15 ]

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





[DDC-3483] [GH-1243] Fixed phpunit tests autoload requirements and moved to composer autoload-dev Created: 10/Jan/15  Updated: 11/Jan/15  Resolved: 11/Jan/15

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

Type: Improvement Priority: Major
Reporter: Doctrine Bot Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: autoloader, composer, phpunit, tests


 Description   

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

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

Message:

...-dev configuration.



 Comments   
Comment by Doctrine Bot [ 10/Jan/15 ]

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

Comment by Doctrine Bot [ 10/Jan/15 ]

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





[DDC-3482] [GH-1242] Attempting to lock a proxy object fails as UOW doesn't init proxy first Created: 10/Jan/15  Updated: 13/Jan/15  Resolved: 13/Jan/15

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.4.7
Fix Version/s: 2.5, 2.4.8
Security Level: All

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: locking, proxy, uninitialized


 Description   

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

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

Message:



 Comments   
Comment by Doctrine Bot [ 13/Jan/15 ]

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

Comment by Doctrine Bot [ 13/Jan/15 ]

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





[DDC-3481] [GH-1241] [3.0] [POC] lazy-load on a per-property base Created: 09/Jan/15  Updated: 24/Jan/15

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Benjamin Eberlei
Resolution: Unresolved 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/1241

Message:

This is just a proof of concept that I hacked together real quick.

This changes how proxies are generated and lazy-loaded in a very radical way:

  • method calls do not cause lazy-loading
  • lazy-loading is triggered by access to non-transient properties (things that need to be lazy-loaded)
  • access to identifiers or non-mapped properties won't cause lazy-loading

Following BC breaks need to be fixed or discussed before going forward on this idea:

  • [ ] proxies don't implement `Doctrine\Common\Proxy\Proxy` anymore, but `ProxyManager\Proxy\GhostObjectInterface` (BC break, needs fixing, can be easily done with some effort)
  • [ ] `serialize($proxy)` now causes proxy initialization (probably needs fixing, as this is a major BC break)

Pending TODOs:

  • [ ] cloning a proxy is still not fully supported (requires dedicated logic in `__clone`)
  • [ ] this is just a PoC, so the code that writes proxies to disk is not yet in place


 Comments   
Comment by Doctrine Bot [ 24/Jan/15 ]

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

Comment by Doctrine Bot [ 24/Jan/15 ]

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





[DDC-3480] ORM\Embeddable does not create ManyToOne column in the database Created: 09/Jan/15  Updated: 11/Jan/15

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

Type: Bug Priority: Major
Reporter: Tomas Voslar Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 1
Labels: None


 Description   

Following Embeddable

/**
 * @ORM\Embeddable
 */
class Address
{
    /**
     * @ORM\ManyToOne(targetEntity="Country")
     */
    protected $country;

won't save country attribute into the database table, other simple attributes (like type="text") saved normally.

    /**
     * @ORM\Embedded(class="LuciniLucini\Adsender\CommonBundle\Entity\Address")
     */
    private $address;


 Comments   
Comment by Marco Pivetta [ 09/Jan/15 ]

The issue seems incomplete to me: what exactly is the failure? Can you make an example?

Comment by Tomas Voslar [ 09/Jan/15 ]

Okay, I am sorry. I have main entity which includes Embeddable entity (Address), this address entity contains country attribute with ManyToOne relation, but this country is not being saved into the database table, other attributes like street (string) are being saved normally.

Comment by Tomas Voslar [ 09/Jan/15 ]

Basically it creates main entity with all fields from embeddable except country which is ManyToOne.

Comment by Marco Pivetta [ 09/Jan/15 ]

Ah, now I get it (I was probably misreading it). We don't support associations from embeddables right now: please check the test suite, but they really don't provide this functionality right now.

Comment by Tomas Voslar [ 09/Jan/15 ]

And is there any chance it will be supported in the near future? Or it's not possible?

Comment by Marco Pivetta [ 09/Jan/15 ]

It will probably not implemented for now, as embeddables (in our vision) are fitting the use-case of ValueObjects. ValueObjects are (usually) supposed to be containing serializable data, and an entity reference is not serializable data.

Comment by Tomas Voslar [ 09/Jan/15 ]

Okay, understood. So it's not good idea to use embeddables for Address entity for example, with this country as relation to another table, right? It seemed to me like best case. Thank you for the support anyway.

Comment by Marco Pivetta [ 09/Jan/15 ]

So it's not good idea to use embeddables for Address entity for example, with this country as relation to another table, right?

I'd rather just save the country identifier in the embeddable instead.

Comment by Tomas Voslar [ 09/Jan/15 ]

So you mean, instead of ManyToOne, save just id=integer (so no relation with entity)?

Comment by Marco Pivetta [ 09/Jan/15 ]

Correct: simple scalar or serializable types

Comment by Tomas Voslar [ 09/Jan/15 ]

https://github.com/doctrine/doctrine2/blob/400acad53355f24137e18d5cd55ccf6ff828cfbe/tests/Doctrine/Tests/ORM/Functional/ValueObjectsTest.php

Line 121 method testDqlOnEmbeddedObjectsField, guess I am wrong, but it seems there should be support for embeddable with relations though.

Comment by Yavin [ 11/Jan/15 ]

Hi,
if is is not supported i think an exception should be thrown when someone use association in embedded class. Now it is just silently ommited.

I found code where embedded metadata is added:
https://github.com/doctrine/doctrine2/blob/573153669c11a6f69201513831d3b8ce5e111d25/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php#L3200





[DDC-3479] [GH-1240] Include IDs in the exception message to ease debugging Created: 08/Jan/15  Updated: 13/Jan/15  Resolved: 13/Jan/15

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

Type: Improvement Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: exception-message, exceptions, identifier, not-found, proxy


 Description   

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

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

Message:

Include IDs in the exception message of the EntityNotFoundException to ease debugging.



 Comments   
Comment by Doctrine Bot [ 09/Jan/15 ]

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

Comment by Doctrine Bot [ 13/Jan/15 ]

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





[DDC-3478] [GH-1239] Fix index duplication for unique association join columns Created: 08/Jan/15  Updated: 09/Jan/15  Resolved: 09/Jan/15

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: duplicate, index, schema-tool

Issue Links:
Reference
relates to DBAL-50 PgSQL driver does not create indexes ... Resolved
relates to DBAL-1063 Exceptions from SchemaTool when runni... Resolved

 Description   

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

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

Message:

Complementary fix for recent DBAL change: https://github.com/doctrine/dbal/commit/fc8beca08600b44e46f7b82998adbcc6d52c31f1#commitcomment-9201441
Avoids index duplication for association mappings using unique join columns. Unique constraints to be created for the join columns are now added before adding the foreign key constraint, so that adding the fk doesn't trigger an implicit index creation.
I did not add any further tests as the current failure already reveals the issue.



 Comments   
Comment by Doctrine Bot [ 08/Jan/15 ]

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

Comment by Doctrine Bot [ 09/Jan/15 ]

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





[DDC-3477] [GH-1238] Avoid prefixing columns when `false` is assigned to `column-prefix` Created: 07/Jan/15  Updated: 08/Jan/15  Resolved: 08/Jan/15

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

Type: Improvement Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: column, embeddables, mapping, prefix, xml

Issue Links:
Dependency
is required for DDC-3293 XML Mappings disallow disabling colum... Resolved

 Description   

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

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

Message:

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

As the issue on JIRA wasn't updated since September/2014, here's a PR.

@Ocramius suggested on [issue](http://www.doctrine-project.org/jira/browse/DDC-3293) about introducing a new attribute called `use-column-prefix`, I'd say that keeping the same attribute as in others drivers would be better.

That's it.



 Comments   
Comment by Doctrine Bot [ 08/Jan/15 ]

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

Comment by Doctrine Bot [ 08/Jan/15 ]

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

Comment by Marco Pivetta [ 08/Jan/15 ]

Handled in DDC-3293





[DDC-3476] JoinTable options are not inherited Created: 06/Jan/15  Updated: 06/Jan/15

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

Type: Bug Priority: Major
Reporter: Enrico Schultz Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: join, joins, orm, table-options


 Description   

I'm working with Symfony 2.6 and Doctrine (MySQL), but the error is in the Doctrine 2 ORM.

I have specified a ManyToMany relation like so:

/**
 *@ORM\Table(name="users", options={"engine"="MyISAM", "collate"="utf8_general_ci"})
 * @ORM\Entity
 */
class User
{
  /**
    * @ORM\ManyToMany(targetEntity="Group", inversedBy="users")
    * @ORM\JoinTable(name="user_groups", joinColumns={@ORM\JoinColumn(name="user_id", referencedColumnName="id")}, inverseJoinColumns={@ORM\JoinColumn(name="group_id", referencedColumnName="id")})
  */
  private $groups;

...
}

All tables should be created as MyISAM and "utf8_general_ci" collation instead of InnoDB and "utf8_unicode_ci". This works fine for all tables except for "user_groups" table because the options are not inherited. As a result the schema is not valid, because foreign keys cannot be created over 2 different collations.

To fix this, I modified class "\Doctrine\ORM\Tools\SchemaTool", function "gatherRelationsSql($class, $table, $schema, &$addedFks, &$blacklistedFks)" and added the following lines in the MANY_TO_MANY block:

if (isset($foreignClass->table['options'])) {
  foreach ($foreignClass->table['options'] as $key => $val) {
    $theJoinTable->addOption($key, $val);
  }
}

Now, it works as I want. The new table is created with the right collation and engine and the foreign keys are created correct. Could you please implement this fix?



 Comments   
Comment by Enrico Schultz [ 06/Jan/15 ]

Please also have a look at DDC-972 where MyISAM support was added. The problem was already mentioned there in the last 4 comments, so it exists at least since 2012.





[DDC-3475] Avoid db connection in constructor Created: 05/Jan/15  Updated: 05/Jan/15

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

Type: Improvement Priority: Minor
Reporter: Stéphane Klein Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Reference
relates to DBAL-1057 Connection is not lazy anymore when g... Open

 Description   

Hi,

Since DBAL 2.5, calling getDatabasePlatform implies in most cases making a connection attempt (https://github.com/doctrine/dbal/blob/master/UPGRADE.md#bc-break-doctrinedbalconnection). Yet that method is called in the constructor of the SchemaTool class, which isn't very clean and can be problematic in some situations.

Are you open to a modification of that class to avoid this issue ? I can think of two workarounds :

  • initializing the platform attribute later
  • removing the attribute, retrieving the platform in getCreateSchemaSql and passing it to subsequent methods

I can send a PR if that's ok for you.



 Comments   
Comment by Steve Müller [ 05/Jan/15 ]

See DBAL-1057.
We still don't know how to properly fix that issue, whether we can do something to make the connection lazier in DBAL already or if we have to adjust ORM / DoctrineBundle and possible other projects to avoid issues.
Currently it looks like we can't do much in DBAL so I tend to say that the complete ORM code has to be scanned for early platform retrieval and fixed to avoid possible issues.
Marco Pivetta Benjamin Eberlei thoughts?





[DDC-3474] [GH-1237] [2.4] Skip public property validation if no reflection class instance present Created: 02/Jan/15  Updated: 02/Jan/15  Resolved: 02/Jan/15

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

Type: Bug Priority: Minor
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Invalid Votes: 0
Labels: schema, validator


 Description   

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

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

Message:

The schema validator triggers a fatal error if you try to validate a class metadata that does not have the `ClassMetdataInfo::$reflClass` set.
This currently breaks the DoctrineBundle test suite. Therefore it's best to skip that validation part if the property is not set.



 Comments   
Comment by Doctrine Bot [ 02/Jan/15 ]

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

Comment by Doctrine Bot [ 02/Jan/15 ]

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





[DDC-3473] @Index and @UniqueConstraint do not require the name parameter Created: 31/Dec/14  Updated: 31/Dec/14

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

Type: Documentation Priority: Minor
Reporter: Benjamin Morel Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

The docs for @Index and @UniqueConstraint both say:

Required attributes:
name: Name of the Index

However, the name parameter does not seem to be required in practice. Omitting it makes Doctrine auto-generate a hash-based name, which is consistent with the indexes generated for foreign keys and is therefore good IMO.

If this is not just a side effect and omitting the name parameter is actually supported, it would be nice to update the docs to reflect this.






[DDC-3472] Use REGEXP or RLIKE Created: 31/Dec/14  Updated: 31/Dec/14  Resolved: 31/Dec/14

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

Type: Documentation Priority: Major
Reporter: Stiff Roy Assignee: Marco Pivetta
Resolution: Won't Fix Votes: 0
Labels: custom-dql-function, dql, regex, sql-walker


 Description   

How can I use the REGEXP or RLIKE commands with Doctrine ORM? In most of the place over internet it says that this is not possible but all the posts are more than 1 year old. I found some function named getRegexpExpression() in https://github.com/doctrine/dbal/blob/master/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php but don't know how to use it.

I am currently upgrading my old project and using php, doctrine and twig (not using any framework like Symfony2). I want to make a local php search (I don't want to use ElasticSearch or Solr as I am on a shared hosting). Lately I used some sql like "SELECT id FROM topics WHERE topic REGEXP '[[:<:]]something[[:>:]]'" . I am mainly searching for an alternative to my query for proper result.

$query = $entityManager->createNativeQuery("SELECT id FROM topics WHERE topic RLIKE '[[:<:]]something[[:>:]]'", $rsm); and it gives a null return value.

If there is any better option for making a search, that will also help me



 Comments   
Comment by Marco Pivetta [ 31/Dec/14 ]

Seems like getRegexpExpression is not being used at all by the ORM. I suggest you to look at how to write custom DQL functions as described in http://www.doctrine-project.org/2010/03/29/doctrine2-custom-dql-udfs.html

Note that public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) can actually access the DB connection and then the platform via Doctrine\ORM\Query\SqlWalker#getConnection().

There is also a MySql specific implementation at https://github.com/beberlei/DoctrineExtensions/blob/5e4ec9c3ec3434151e1c73144b4ab87ae30aefbc/lib/DoctrineExtensions/Query/Mysql/Regexp.php

This won't be implemented in core so far, closing.





[DDC-3471] [GH-1236] Minor docs fix: missing word 'do' Created: 31/Dec/14  Updated: 31/Dec/14  Resolved: 31/Dec/14

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

Type: Documentation Priority: Trivial
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: grammar, typo


 Description   

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

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

Message:



 Comments   
Comment by Doctrine Bot [ 31/Dec/14 ]

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

Comment by Doctrine Bot [ 31/Dec/14 ]

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





[DDC-3470] [GH-1235] Consistent return type confirming with interface Created: 31/Dec/14  Updated: 31/Dec/14  Resolved: 31/Dec/14

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

Type: Bug Priority: Minor
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: interface, return-type


 Description   

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

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

Message:

The BasicEntityPersister always returns an array as specified in the interface. With this change the JoinedSubclassPersister has the same behaviour and strictly follows the interface.

There's no known issue but this PR was for the little monk inside me



 Comments   
Comment by Doctrine Bot [ 31/Dec/14 ]

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

Comment by Doctrine Bot [ 31/Dec/14 ]

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





[DDC-3469] [GH-1234] added basic test for private embedded field in inheritence Created: 30/Dec/14  Updated: 30/Dec/14

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

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

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

Message:

The tried creating a test case for DDC-3467(http://www.doctrine-project.org/jira/browse/DDC-3467). I hope I put everything in the right place as my knowledge of this project is currently limited.






[DDC-3467] Embeddable in inheritance currently must be protected Created: 30/Dec/14  Updated: 30/Dec/14

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

Type: Bug Priority: Minor
Reporter: Marco Pfeiffer Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: mapping, orm
Environment:

ubuntu 14.04 PHP 5.5.9-1ubuntu4.5 (cli)



 Description   

I have a setup similar to this one :

Planet.php
/**
 * @ORM\Table()
 * @ORM\Entity(readOnly=true)
 * @ORM\InheritanceType("SINGLE_TABLE")
 **/
abstract class Planet
{
    /* ... */
    /**
     * @var Position
     * @ORM\Embedded(class="Position")
     */
    private $position;
}
Sun.php
/**
 * @ORM\Entity(readOnly=true)
 **/
class Sun extends Planet
{
}

This causes the following error:

[ReflectionException]
Property Sun::$position does not exist

This can easily be fixed by making the embeddable protected, but if I didn't miss anything, a private embed should work too.



 Comments   
Comment by Marco Pivetta [ 30/Dec/14 ]

Can you convert this into a test case? Seems trivial to fix afterwards





[DDC-3466] [GH-1233] [Minor] Refactoring to avoid duplicate code Created: 30/Dec/14  Updated: 04/Jan/15  Resolved: 04/Jan/15

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: duplication, refactoring, second-level-cache


 Description   

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

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

Message:

Very merry end of the year



 Comments   
Comment by Doctrine Bot [ 30/Dec/14 ]

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

Comment by Doctrine Bot [ 04/Jan/15 ]

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





[DDC-3465] [GH-1232] Explicit example of partial indexes Created: 29/Dec/14  Updated: 22/Jan/15  Resolved: 22/Jan/15

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

Type: Documentation Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: column-options, ddl, index, partial-index


 Description   

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

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

Message:

This provide an explicit example of partial indexes annotations. Specifically including all parentheses as returned by PostgreSql.

This is needed following https://github.com/doctrine/dbal/pull/716



 Comments   
Comment by Doctrine Bot [ 29/Dec/14 ]

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

Comment by Doctrine Bot [ 22/Jan/15 ]

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





[DDC-3464] [GH-1231] Backport 'Merge pull request #1098 from encoder32/DDC-1590' to 2.4 branch Created: 26/Dec/14  Updated: 17/Jan/15  Resolved: 17/Jan/15

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: entityGenerator, reflection, traits

Issue Links:
Reference
relates to DDC-1590 Fix Inheritance in Code-Generation Resolved

 Description   

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

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

Message:

Backport #1098 to 2.4 branch



 Comments   
Comment by Doctrine Bot [ 28/Dec/14 ]

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

Comment by Doctrine Bot [ 17/Jan/15 ]

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





[DDC-3463] Generated enitities have singular variable names for many to many relationships Created: 25/Dec/14  Updated: 25/Dec/14

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

Type: Improvement Priority: Major
Reporter: John J Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Running doctrine:generate:entities from the command line gives entities that have instance variables arrays, but their names are singular. For example if there are many "tools" associated with a "toolbox" via a many to one or many to many realationship, the toolbox class should have an array variable named "tools". It has an array but the name of it is "tool" instead of "tools". The name of the variable should be singular for one to one relationships and plural for whenever its an array






[DDC-3462] [GH-1230] Allow dumping SQL query when passing DQL on cli Created: 24/Dec/14  Updated: 17/Jan/15  Resolved: 07/Jan/15

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

Type: New Feature Priority: Major
Reporter: Doctrine Bot Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: cli, console, dql, sql

Issue Links:
Reference
is referenced by DDC-3513 [GH-1262] Fixes the broken DQL command Resolved

 Description   

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

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

Message:

This adds a new commandline option '--show-sql' which will dump out the generated SQL instead of querying the database with query-dql



 Comments   
Comment by Doctrine Bot [ 24/Dec/14 ]

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





[DDC-3461] [GH-1229] Identity in onetoone association builder Created: 23/Dec/14  Updated: 26/Jan/15

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

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

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

Message:



 Comments   
Comment by Doctrine Bot [ 23/Dec/14 ]

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

Comment by Doctrine Bot [ 24/Jan/15 ]

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

Comment by Doctrine Bot [ 26/Jan/15 ]

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

Comment by Doctrine Bot [ 26/Jan/15 ]

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





[DDC-3460] SchemaTool create unnecessry work by trying to set foreign keys on MyISAM tables Created: 20/Dec/14  Updated: 20/Dec/14

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

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


 Description   

When I run SchemaTool::getSchemaFromMetadata, it always adds foreign keys constraints for all association fields (in SchemaTool::gatherRelationJoinColumns). Since I've set the table's engine option to 'MyISAM', this is quite pointless, since they won't get created anyways.

When I run SchemaManager::createSchema, it does not detect any foreign keys, so the SchemaDiff from Comparator will contain a large number of (pointless) ADD CONSTRAINT FK_xxx FOREIGN KEY commands.

For the moment, I work around this by removing them in a ToolEvents::postGenerateSchemaTable listener, but shouldn't SchemaTool be able to detect this situation itself?






[DDC-3459] double inversed-by leads to incomprehensible error message Created: 20/Dec/14  Updated: 20/Dec/14

Status: Open
Project: Doctrine 2 - ORM
Component/s: Mapping Drivers
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor
Reporter: Tom Vogt Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

When mapping a many-to-one relationship (in XML format), I made the mistake of having both sides be inversed-by (instead of one using mapped-by). This resulted in the following error message on doctrine:schema:update

Doctrine\ORM\ORMException: This behaviour is (currently) not supported by Doctrine 2 (uncaught exception) at /Volumes/User Data/Users/Tom/Sites/BM2/vendor/doctrine/orm/lib/Doctrine/ORM/ORMException.php line 217 while running console command `doctrine:schema:update`

This message could be more helpful. It doesn't tell me where the error is nor what the error is.






[DDC-3458] [GH-1228] Fixed many small phpcs issues Created: 19/Dec/14  Updated: 24/Jan/15

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

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

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

Message:

This pr fixes many small phpcs issues



 Comments   
Comment by Doctrine Bot [ 19/Dec/14 ]

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

Comment by Doctrine Bot [ 24/Jan/15 ]

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





[DDC-3457] [GH-1227] Ensure query cache is not ArrayCache in production Created: 19/Dec/14  Updated: 09/Jan/15  Resolved: 09/Jan/15

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

Type: Improvement Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: cache, cli, command, production-settings

Issue Links:
Reference
relates to DDC-3379 [GH-1177] Ensure metadata cache is no... Resolved

 Description   

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

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

Message:

This PR applies the same check for the query cache that was done for the metadata cache in #1177 (as suggested by @stof).



 Comments   
Comment by Doctrine Bot [ 09/Jan/15 ]

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

Comment by Doctrine Bot [ 09/Jan/15 ]

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





[DDC-3456] [GH-1226] Update Travis badges to use the SVG version Created: 19/Dec/14  Updated: 19/Dec/14  Resolved: 19/Dec/14

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

Type: Documentation Priority: Trivial
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: badges, documentation, readme, travis


 Description   

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

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

Message:



 Comments   
Comment by Doctrine Bot [ 19/Dec/14 ]

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

Comment by Doctrine Bot [ 19/Dec/14 ]

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





[DDC-3455] [GH-1225] Test for RuntimeException in AnnotationExporter::exportClassMetadata() Created: 19/Dec/14  Updated: 24/Jan/15

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

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

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

Message:



 Comments   
Comment by Doctrine Bot [ 24/Jan/15 ]

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

Comment by Doctrine Bot [ 24/Jan/15 ]

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





[DDC-3454] [GH-1224] Updated setParameters function for not replace all parameters Created: 17/Dec/14  Updated: 13/Jan/15  Resolved: 13/Jan/15

Status: Closed
Project: Doctrine 2 - ORM
Component/s: DQL
Affects Version/s: None
Fix Version/s: 2.5
Security Level: All

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Guilherme Blanco
Resolution: Won't Fix Votes: 0
Labels: dql, query, querybuilder


 Description   

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

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

Message:

When you create QueryBuilder and you bind some parameters, if you use setParameters function after bind other parameters, previous parameters are removed(https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/QueryBuilder.php#L558). This would not be a problem if it was the same behaviour with the attribute $_parameterMappings (in ParserResult), but it's not the case, given that it keeps the number of parameters introduced, throwing an exception(https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Query.php#L293). To prevent this, I've made it initialize the setParameters with the existing ones.



 Comments   
Comment by Doctrine Bot [ 17/Dec/14 ]

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

Comment by Doctrine Bot [ 13/Jan/15 ]

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





[DDC-3453] [GH-1223] Refactored construction of the EntityManager out to an EntityManagerFactory Created: 17/Dec/14  Updated: 18/Jan/15  Resolved: 18/Jan/15

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

Type: Improvement Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Won't Fix Votes: 0
Labels: constructor, entitymanager, setup

Issue Links:
Reference
relates to DDC-3515 [GH-1263] #1223 DDC-3453 - make `Enti... Open

 Description   

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

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

Message:

Added tests for the factory (needed to refactor the OrmTestCase so I could reuse mock config and mock connections).

This pattern is well established in Hibernate, I've been wondering why we don't have it in Doctrine.



 Comments   
Comment by Doctrine Bot [ 18/Jan/15 ]

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

Comment by Doctrine Bot [ 18/Jan/15 ]

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





[DDC-3452] [GH-1222] Embeddables in metadata builder Created: 17/Dec/14  Updated: 28/Jan/15

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

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

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

Message:

Embeddables set the `$classMetadata->isEmbeddedClass = true` and sets `$classMetadata->isMappedSuperclass = false`, imitating the `switch` in xml / yml drivers.

Embeddeds have 2 methods, as other types have: `addEmbedded` is a one-off adder with fluent behavior, and `createEmbedded` returns an instance of `EmbeddedBuilder`. The class is very thin right now, but it's a good way to lay ground for improvements on embedded creation in the future.

This one is probably more useful than the last one, @Ocramius



 Comments   
Comment by Doctrine Bot [ 24/Jan/15 ]

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

Comment by Doctrine Bot [ 26/Jan/15 ]

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

Comment by Doctrine Bot [ 28/Jan/15 ]

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

Comment by Doctrine Bot [ 28/Jan/15 ]

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





[DDC-3451] [GH-1221] Very simple refactoring of the setup class Created: 16/Dec/14  Updated: 17/Dec/14  Resolved: 17/Dec/14

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

Type: Improvement Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Won't Fix Votes: 0
Labels: None


 Description   

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

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

Message:

Moved logic to instance methods.

This way, a project could depend on a Setup class instance (or extend it) and resolve it through a DI container.
To allow for BC, instance methods were renamed and a `__callStatic` magic method deals with finding them.
Tests were duplicated to test for static access and instance access.



 Comments   
Comment by Doctrine Bot [ 16/Dec/14 ]

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

Comment by Doctrine Bot [ 17/Dec/14 ]

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





[DDC-3450] Embeddables containing only nested embeddables are not hydrated properly Created: 16/Dec/14  Updated: 16/Dec/14

Status: Open
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: 2.5
Fix Version/s: None

Type: Bug Priority: Major
Reporter: James Moss Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

I have the following object mapping:

Location (entity)

  • name <string>
  • bounds <Bounds>

Bounds (embeddable)

  • northeast <Coords>
  • southwest <Coords>

Coords (embeddable)

  • latitude <float>
  • longitude <float>

This setup works fine when persisting entities, the database schema is correct, etc. but when I fetch my `Location` entity afterwards the `bounds` property is wrong. It looks something like this. Calling `getBounds()` on `Location` returns something like:

Coords

  • latitude <float>
  • longitude <float>
  • northeast <Coords>
  • southwest <Coords>

As if the `Coords` embeddable has been transposed with the `Bounds` embeddable.

If I add another property to `Bounds` that isn't an embeddable (say a string) then it's hydrated correctly.



 Comments   
Comment by Marco Pivetta [ 16/Dec/14 ]

James Moss could you come up with a small test case in https://github.com/doctrine/doctrine2/tree/v2.4.7/tests/Doctrine/Tests/ORM/Functional/Ticket ?





[DDC-3449] Single scalar Result and Hidden field Created: 15/Dec/14  Updated: 15/Dec/14

Status: Open
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.4.6
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Thomas Gallice Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

I have try to get a single scalar result but my query contains a HIDDEN field. The result is the `NonUniqueResultException` exception.






[DDC-3448] @OrderBy on eager @OneToMany does not work Created: 13/Dec/14  Updated: 13/Dec/14

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

Type: Bug Priority: Major
Reporter: Oliver Hoff Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

generated code when eagerly fetching:

SELECT 
  t0.id AS id_8,
  t19.category_id AS category_id_23 
FROM 
  category t0 
  LEFT JOIN attribute_category t19 ON t19.category_id = t0.id 
WHERE 
  t0.id = ?

when fetching lazy the collection query has the ORDER BY clause






[DDC-3447] Identifier Generation Strategy "UUID" is missing Created: 10/Dec/14  Updated: 10/Dec/14

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

Type: Documentation Priority: Minor
Reporter: David Fuhr Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: GeneratedValue


 Description   

The listing of the Identifier Generation Strategies as http://doctrine-orm.readthedocs.org/en/latest/reference/basic-mapping.html#identifier-generation-strategies misses the UUID.

The annotation reference contains the value for UUID http://doctrine-orm.readthedocs.org/en/latest/reference/annotations-reference.html#annref-generatedvalue

So it should be added at the "Identifier Generation Strategies"






[DDC-3446] [GH-1219] Comparison like/notlike support Created: 10/Dec/14  Updated: 24/Jan/15

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

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

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

Message:

Support `Comparison::LIKE` and `Comparison::NOTLIKE` additionally to doctrine/collections#50

as alternative for #1150



 Comments   
Comment by Doctrine Bot [ 24/Jan/15 ]

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

Comment by Doctrine Bot [ 24/Jan/15 ]

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





[DDC-3445] ERROR GENERATED VALUE (UUID) Created: 10/Dec/14  Updated: 11/Dec/14

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

Type: Bug Priority: Major
Reporter: MUHAMAD SURYA IKSANUDIN Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: orm, postgresql


 Description   

UUID is not working (missing ID and need to set manually)

/**
 * @ORM\Entity
 * @ORM\Table(name = "utl_role")
 */
class Role implements EntityInterface
{
    /**
     * @ORM\Id
     * @ORM\Column(name = "id", type = "guid")
     * @ORM\GeneratedValue(strategy = "UUID")
     **/
    protected $id;

===============================

i need to pass the id manually

$role->setId((new UuidGenerator())->generate($this->em, $role)); 

because the id is not set and error when i try to persist.

This error is arrive when i try to persist an entity i loop

================================

I use postgresql 9.3



 Comments   
Comment by Marco Pivetta [ 11/Dec/14 ]

Can you check this also against master (2.5-dev)?

Comment by MUHAMAD SURYA IKSANUDIN [ 11/Dec/14 ]

i think it same because the uuid generator is same

https://github.com/doctrine/doctrine2/blob/master/lib%2FDoctrine%2FORM%2FId%2FUuidGenerator.php#L42

in that code, i see the uuid is generated from database provider/platform, i suggest to use code base generator like

https://github.com/ramsey/uuid/blob/master/src%2FUuid.php

it just my suggestion

thanks





[DDC-3444] [GH-1218] Failing test case for cascading refresh Created: 09/Dec/14  Updated: 24/Jan/15

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

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

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

Message:



 Comments   
Comment by Doctrine Bot [ 24/Jan/15 ]

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





[DDC-3443] Doctrine Custom Type always converted as string, when not wanted Created: 09/Dec/14  Updated: 19/Dec/14  Resolved: 19/Dec/14

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

Type: Bug Priority: Major
Reporter: Romain Assignee: Benjamin Eberlei
Resolution: Won't Fix Votes: 0
Labels: dql, postgresql
Environment:

Symfony2, PDO_PostgreSQL



 Description   

Hello,

trying to define a Custom Type in my Symfony2 application, I can't find how to write the convertToDatabaseValue function for working with native points in PostgreSQL (!= PostGIS extension).

Wished syntax :

'SELECT [...] FROM Addresses t0 WHERE t0.location = ?' with params ['(2.352,48.857)']

I use this convertToDatabaseValue function :

    public function convertToDatabaseValue($value, AbstractPlatform $platform) {
        if (!$value) return;

        return "'(".$value->getX().','.$value->getY().")'";
    }

DQL, creates this SQL query :

'SELECT [...] FROM Addresses t0 WHERE t0.location = ?' with params ["'(2.352,48.857)'"]

-> Double quotes are automatically added, the parameter is interpreted as string.

I don't know if it is a bug or if I am doing anything wrong ?

Thank you.



 Comments   
Comment by Marco Pivetta [ 10/Dec/14 ]

Please check http://doctrine-orm.readthedocs.org/en/latest/cookbook/advanced-field-value-conversion-using-custom-mapping-types.html and compare it with your codebase.

Comment by Romain [ 10/Dec/14 ]

As I understand, the function convertToDatabaseValue build the format from the value into "with params (############)"

But it does always put double quotes so that my value becomes a string.

convertToDatabaseValueSQL build the format before, at the placeholder and here, I don't want to change anything.

I tried also

getBindingType()

{ return \PDO::PARAM_NULL; }

Hoping that were going to remove the quotes, but it doesn't.

Any suggestion ?

Comment by Steve Müller [ 12/Dec/14 ]

Not sure but I think the double quotes are just added for the debug output. What would be the native SQL that you expect?
I think you will have to define \PDO::PARAM_STRING as binding type and remove the single quotes around your database value:

public function convertToDatabaseValue($value, AbstractPlatform $platform) {
    if (!$value) return;

    return "(".$value->getX().','.$value->getY().")";
}
Comment by Romain [ 19/Dec/14 ]

OK it is working without parenthesis ...

Thank you for your help .

Comment by Romain [ 19/Dec/14 ]

There were no problem, wrong syntax in my custom Typ ...





[DDC-3442] [GH-1217] @DDC3441 failing test cases for the ticket Created: 09/Dec/14  Updated: 24/Jan/15

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Dependency
is required for DDC-3441 Unidirectional ManyToOne Not Lazy Loa... Open

 Description   

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

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

Message:

Failing test cases for the ticket DDC-3441(http://www.doctrine-project.org/jira/browse/DDC-3441)



 Comments   
Comment by Marcus Fulbright [ 09/Dec/14 ]

I didn't realize a ticket would get automatically opened when I submitted a pull request. I already put relevant details for this in DDC-3441. This is a duplicate.

Comment by Doctrine Bot [ 11/Dec/14 ]

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

Comment by Doctrine Bot [ 24/Jan/15 ]

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

Comment by Doctrine Bot [ 24/Jan/15 ]

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





[DDC-3441] Unidirectional ManyToOne Not Lazy Loading Created: 09/Dec/14  Updated: 24/Jan/15

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

Type: Bug Priority: Critical
Reporter: Marcus Fulbright Assignee: Marco Pivetta
Resolution: Unresolved Votes: 0
Labels: lazy-loading, proxy, public-properties, reflection

Issue Links:
Dependency
depends on DDC-3442 [GH-1217] @DDC3441 failing test cases... Open

 Description   

The Unidirectional ManyToOne association described in the docs does not lazy load correctly. The appropriate SQL will get executed, and the returned Proxy does pass type hinting for the correct class. However, the lazy loaded object always has the following properties:

  • _initializer_
  • _cloner_
  • _isInitialized_
  • lazyPropertiesDefaults

Any properties from the class definition do not show up. This is problematic when trying to get reflected properties and their values. Methods are correctly reflected.

Pull request for failing test case



 Comments   
Comment by Marcus Fulbright [ 09/Dec/14 ]

Let me know if anything else is needed.

Comment by Doctrine Bot [ 11/Dec/14 ]

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

Comment by Marco Pivetta [ 11/Dec/14 ]

Looks like a current ORM limitation (private properties lazy loading).

Related:

Comment by Doctrine Bot [ 24/Jan/15 ]

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

Comment by Doctrine Bot [ 24/Jan/15 ]

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





[DDC-3440] <Inheritance SINGLE_TABLE> Entity merge not working with parent entity Created: 08/Dec/14  Updated: 08/Dec/14  Resolved: 08/Dec/14

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

Type: Bug Priority: Major
Reporter: Brian Nguyen Assignee: Marco Pivetta
Resolution: Cannot Reproduce Votes: 0
Labels: None


 Description   

I have problem when try to merge the ProfilePersonEntity, all the fields in ProfilePersonEntity was merged, but all another fields of parent class cannot.
I worked fine (wonderful) when i loaded with find(entity id), the DB data mapped 100% to the entity.

Please check the code below

ProfileEntity.php
======================================================================
/**

  • @Entity
  • @Table(name="PROFILE")
  • @InheritanceType("SINGLE_TABLE")
  • @DiscriminatorColumn(name="type", type="string")
  • @DiscriminatorMap( { * "Profile" = "ProfileEntity", * "ProfilePerson" = "ProfilePersonEntity", * "ProfileCompany" = "ProfileCompanyEntity" * }

    )
    */
    class ProfileEntity extends LockableEntity

    { /** * @Column(name="TYPE", type="string", length=15) */ private $type; /** * @Column(name="NAME", type="string", length=45) */ private $name; ... }

ProfilePersonEntity.php
======================================================================
/**

  • @Entity
    */
    class ProfilePersonEntity extends ProfileEntity { /** * @Column(name="LAST_NAME", type="string", length=45) */ private $lastName; ... }

LockableEntity.php
======================================================================
/** @MappedSuperclass */
class LockableEntity extends BaseEntity

{ /** @Column(name="LOCKED", type="string", nullable=true, length=45) */ private $lockOwner; ... }

BaseEntity.php
======================================================================
/**

  • @MappedSuperclass
  • @HasLifecycleCallbacks
    */
    class BaseEntity extends AbstractEntity { /** * @Id * @GeneratedValue * @Column(name="ID", type="integer") */ private $id; /** * @Version * @Column(name="VERSION", type="integer") */ private $version; ... }

...
$this->entityManager->merge($entity);
$this->entityManager->flush();
...



 Comments   
Comment by Marco Pivetta [ 08/Dec/14 ]

Cannot reproduce: missing reproducible test case.





[DDC-3439] [GH-1216] test XML export driver, the field options, for #1214 Created: 08/Dec/14  Updated: 10/Dec/14  Resolved: 10/Dec/14

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: export-xml, xml


 Description   

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

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

Message:

test for #1214



 Comments   
Comment by Doctrine Bot [ 08/Dec/14 ]

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

Comment by Doctrine Bot [ 10/Dec/14 ]

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

Comment by Doctrine Bot [ 10/Dec/14 ]

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





[DDC-3438] [GH-1215] Don't make this class Final Created: 08/Dec/14  Updated: 09/Dec/14  Resolved: 08/Dec/14

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Invalid Votes: 0
Labels: None


 Description   

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

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

Message:

Why: It makes testing painful

https://github.com/phpspec/prophecy/issues/102



 Comments   
Comment by Doctrine Bot [ 08/Dec/14 ]

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

Comment by Doctrine Bot [ 09/Dec/14 ]

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





[DDC-3437] [GH-1213] fix instantiation of embedded object in ReflectionEmbeddedProperty Created: 06/Dec/14  Updated: 08/Dec/14  Resolved: 08/Dec/14

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: abstract-class, embeddables, inheritance, reflection

Issue Links:
Reference
relates to DDC-3431 [GH-1207] Embedded classes reflection... Resolved

 Description   

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

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

Message:

Recently, ReflectionEmbeddedProperty was updated to extend ReflectionProperty. This broke any embeddable that extends an abstract class. That's because if a property is defined in the abstract class, <code>$this->class</code> is alway the abstract class and thus cannot be instantiated. The <code>$class</code> parameter that is passed into the constructor needs to be stored, and that class should be instantiated, not the the property's declaring class.



 Comments   
Comment by Doctrine Bot [ 07/Dec/14 ]

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

Comment by Doctrine Bot [ 08/Dec/14 ]

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





[DDC-3436] [GH-1212] [DDC-3108] Fix regression where join aliases were no longer accessible in Criteria expressions Created: 06/Dec/14  Updated: 17/Jan/15  Resolved: 17/Jan/15

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: DQL
Affects Version/s: Git Master, 2.4.7
Fix Version/s: 2.5
Security Level: All

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: aliases, criteria, join

Issue Links:
Reference
relates to DDC-2764 An orderBy on Criteria leads to DQL s... Resolved
relates to DDC-3108 Criteria cannot reference a joined ta... Resolved

 Description   

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

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

Message:

The solution to issue DDC-2764 was to blanket prefix all the fields with the root alias. The result was then impossible to use fields from multiple FROM tables or a JOIN.

This patch injects all available aliases into the comparison, if a field uses one of the aliases it will pass without modification. If it is an unknown alias it will prefix the first rootAlias listed using the same functionality as the deprecated getRootAlias() function.

Also improves the ORDER BY on Criteria expressions, again introduced by DDC-2764 using the above functionality, this was out of scope of bug DDC-3108.

Added unit tests to test new functionality.



 Comments   
Comment by Doctrine Bot [ 08/Dec/14 ]

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

Comment by Doctrine Bot [ 17/Jan/15 ]

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





[DDC-3435] [GH-1211] DDC-3434 - paginator ignores `HIDDEN` fields in `ORDER BY` query Created: 05/Dec/14  Updated: 05/Dec/14  Resolved: 05/Dec/14

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: DQL, Tools
Affects Version/s: 2.4.4, 2.4.5, 2.4.6
Fix Version/s: 2.5, 2.4.7
Security Level: All

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: dql, limitsubqueryoutputwalker, paginator

Issue Links:
Dependency
is required for DDC-3434 LimitSubqueryOutputWalker does not re... Resolved

 Description   

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

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

Message:

See DDC-3434 ( http://www.doctrine-project.org/jira/browse/DDC-3434 )



 Comments   
Comment by Doctrine Bot [ 05/Dec/14 ]

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

Comment by Doctrine Bot [ 05/Dec/14 ]

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





[DDC-3434] LimitSubqueryOutputWalker does not retain correct ORDER BY expression fields when dealing with HIDDEN sort fields Created: 05/Dec/14  Updated: 05/Dec/14  Resolved: 05/Dec/14

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: DQL, Tools
Affects Version/s: 2.4.4, 2.4.5, 2.4.6
Fix Version/s: 2.5, 2.4.7
Security Level: All

Type: Bug Priority: Major
Reporter: Marco Pivetta Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: dql, limitsubqueryoutputwalker, paginator

Issue Links:
Dependency
depends on DDC-3435 [GH-1211] DDC-3434 - paginator ignore... Resolved
Reference
relates to DDC-3336 Undefined property: Doctrine\ORM\Quer... Resolved
relates to DDC-1958 pager produces wrong results on postg... Resolved

 Description   

As per discussion in DDC-3336, the Doctrine\ORM\Tools\Pagination\LimitSubqueryOutputWalker does not retain the correct fields in the ORDER BY condition when one of the selected fields is marked as HIDDEN.

As an example, take a DQL query like:

SELECT a, a.name AS HIDDEN ord FROM Doctrine\Tests\ORM\Tools\Pagination\Author a ORDER BY ord DESC

This will result in an SQL query like:

SELECT DISTINCT id_0 FROM (SELECT a0_.id AS id_0, a0_.name AS name_1, a0_.name AS name_2 FROM Author a0_ ORDER BY name_2 DESC) dctrn_result

Removing the HIDDEN modifier will cause the query to produce the correct SQL:

SELECT DISTINCT id_0, name_2 FROM (SELECT a0_.id AS id_0, a0_.name AS name_1, a0_.name AS name_2 FROM Author a0_ ORDER BY name_2 DESC) dctrn_result ORDER BY name_2 DESC


 Comments   
Comment by Doctrine Bot [ 05/Dec/14 ]

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





[DDC-3433] [GH-1210] DDC-3336 - undefined property with paginator walker and scalar expression in ORDER BY clause Created: 05/Dec/14  Updated: 05/Dec/14  Resolved: 05/Dec/14

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: DQL, Tools
Affects Version/s: 2.4.4, 2.4.5, 2.4.6
Fix Version/s: 2.5, 2.4.7
Security Level: All

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: ast, dql, limitsubqueryoutputwalker, paginator

Issue Links:
Dependency
is required for DDC-3336 Undefined property: Doctrine\ORM\Quer... Resolved

 Description   

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

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

Message:

Ping @glen-84

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



 Comments   
Comment by Doctrine Bot [ 05/Dec/14 ]

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





[DDC-3432] [GH-1208] DDC-3427 - class metadata factory should accept `EntityManagerInterface` instances Created: 05/Dec/14  Updated: 05/Dec/14  Resolved: 05/Dec/14

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: Mapping Drivers, ORM
Affects Version/s: 2.4.6
Fix Version/s: 2.5
Security Level: All

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: classmetadatafactory, entitymanager, entitymanagerinterface

Issue Links:
Dependency
is required for DDC-3427 Doctrine\ORM\Mapping\ClassMetadataFac... Resolved

 Description   

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

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

Message:

See DDC-3427 ( http://www.doctrine-project.org/jira/browse/DDC-3427 )



 Comments   
Comment by Doctrine Bot [ 05/Dec/14 ]

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

Comment by Doctrine Bot [ 05/Dec/14 ]

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





[DDC-3431] [GH-1207] Embedded classes reflection new instance creation with internal PHP classes Created: 05/Dec/14  Updated: 08/Dec/14  Resolved: 05/Dec/14

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: embeddables, instantiator, internal-php-classes, reflection

Issue Links:
Reference
is referenced by DDC-3437 [GH-1213] fix instantiation of embedd... Resolved

 Description   

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

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

Message:



 Comments   
Comment by Doctrine Bot [ 05/Dec/14 ]

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

Comment by Doctrine Bot [ 05/Dec/14 ]

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





[DDC-3430] [GH-1206] matching should not change critera Created: 04/Dec/14  Updated: 17/Jan/15  Resolved: 17/Jan/15

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: Lazy Loading, ORM
Affects Version/s: Git Master, 2.4.7
Fix Version/s: 2.5
Security Level: All

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: collection, criteria, matching, mutability, persistent-collection


 Description   

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

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

Message:

The matching should behave like in ArrayCollection, where it is not changed.
The criteria should be cloned so that it could be used for more than one matching operation.



 Comments   
Comment by Doctrine Bot [ 15/Jan/15 ]

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

Comment by Doctrine Bot [ 17/Jan/15 ]

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





[DDC-3429] [GH-1205] Hotfix - #1200 symfony 2.7 deprecation fixes Created: 04/Dec/14  Updated: 04/Dec/14  Resolved: 04/Dec/14

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: console, symfony, yaml

Issue Links:
Reference
relates to DDC-3422 [GH-1200] Fix Yaml::parse() errors Resolved

 Description   

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

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

Message:

See #1200



 Comments   
Comment by Doctrine Bot [ 04/Dec/14 ]

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

Comment by Doctrine Bot [ 04/Dec/14 ]

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





[DDC-3428] [GH-1204] Fix sequence-generator in MetaData exporter for XML Driver. Created: 04/Dec/14  Updated: 04/Dec/14  Resolved: 04/Dec/14

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: Mapping Drivers, Tools
Affects Version/s: 2.4.6
Fix Version/s: 2.5
Security Level: All

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: convert-mapping, export-xml, mapping, xml


 Description   

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

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

Message:

Make XMLExporter writes sequence-generator if a definition about it exists.



 Comments   
Comment by Doctrine Bot [ 04/Dec/14 ]

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

Comment by Doctrine Bot [ 04/Dec/14 ]

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





[DDC-3427] Doctrine\ORM\Mapping\ClassMetadataFactory explicitly accepts EntityManager Created: 04/Dec/14  Updated: 05/Dec/14  Resolved: 05/Dec/14

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: Mapping Drivers, ORM
Affects Version/s: 2.4.6
Fix Version/s: 2.5
Security Level: All

Type: Bug Priority: Major
Reporter: Frank Wallen Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: orm
Environment:

Symfony2


Issue Links:
Dependency
depends on DDC-3432 [GH-1208] DDC-3427 - class metadata f... Resolved

 Description   

The setEntityManager only accepts instances of EntityManager thus blocking any objects extending EntityManager. It should expect EntityManagerInstance.






[DDC-3426] [GH-1203] DDC3424Test.php Created: 03/Dec/14  Updated: 03/Dec/14  Resolved: 03/Dec/14

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Steve Müller
Resolution: Incomplete Votes: 0
Labels: None


 Description   

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

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

Message:

the problem consists in the insert's ordre



 Comments   
Comment by Doctrine Bot [ 03/Dec/14 ]

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

Comment by Doctrine Bot [ 03/Dec/14 ]

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

Comment by Steve Müller [ 03/Dec/14 ]

Closed by the contributor.





[DDC-3425] [GH-1202] Checks key exists rather than isset Created: 03/Dec/14  Updated: 08/Dec/14  Resolved: 08/Dec/14

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: column-options, null, schema, table-options


 Description   

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

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

Message:

If the default value is set to `null`, `isset` will return `false` even though the key is actually there for a reason.



 Comments   
Comment by Doctrine Bot [ 03/Dec/14 ]

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

Comment by Doctrine Bot [ 08/Dec/14 ]

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





[DDC-3424] Class Table Inheritance - wrong table order on insert with more than one level of inheritance Created: 02/Dec/14  Updated: 04/Dec/14

Status: Awaiting Feedback
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.3.3
Fix Version/s: 2.2.3
Security Level: All

Type: Bug Priority: Major
Reporter: mohammed Assignee: Marco Pivetta
Resolution: Unresolved Votes: 0
Labels: ORM
Environment:

Mysql



 Description   

when i use class table inheritance with multiple levels in doctrine :
Account<=User<=Dealer
(Dealer inherits from User, User from Account)
Account has the discriminator column and mapping.
when i persist a new Dealer entity I get a foreign key error because there is no row in the User table.
So the order in which the insert statements are executed:
1) Insert into Account
2) Insert into Dealer (which causes the error)
3) insert into User
Can someone help me thanks in advance.



 Comments   
Comment by Marco Pivetta [ 02/Dec/14 ]

Is this also valid for 2.4.x and master? 2.3.3 is a very old version.

Additionally, could you come up with a small reproduction test case? You can check the ones at https://github.com/doctrine/doctrine2/tree/v2.4.6/tests/Doctrine/Tests/ORM/Functional/Ticket for reference

Comment by mohammed [ 03/Dec/14 ]

This is also valid for 2.4.x and master
this is the test case https://github.com/rogerghost/doctrine2/blob/patch-1/tests/Doctrine/Tests/ORM/Persisters/DDC3424Test.php





[DDC-3423] Column Ordering when creating tables using doctrine:schema:update Created: 01/Dec/14  Updated: 01/Dec/14

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

Type: Improvement Priority: Minor
Reporter: Raja Venkataraman Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

When you have a Base class (annotated with @MappedSuperClass) having some columns, say, createdById, createdDateTime and child entities deriving from the BaseClass, the ordering of the SQL when running doctrine:schema:update looks like

createdById
createdDateTime
id
field1
field2

i.e. the columns of the Base class come up first and then that of the children. It looks odd when you write a SQL to insert into these tables because the default ordering is not what you expect (Which would be derived class columns first and then base class).

I looked into ClassMetadataFactory that adds the fields to the classmetadata and figured if we could move the following
$this->addInheritedFields($class, $parent);
$this->addInheritedRelations($class, $parent);

to after the point where the local fields are added to the classmetadata, this problem is solved.

It might be even better if we have an annotation to specify the Ordering of columns but nevertheless this will help in cases where the base class columns appear after the derived class columns.

Note: Did look into columnDefinition annotation to specify a "AFTER <column>", but that cannot be used during CREATE TABLE, only for ALTER TABLE and that too, its mysql specific.






[DDC-3422] [GH-1200] Fix Yaml::parse() errors Created: 30/Nov/14  Updated: 04/Dec/14  Resolved: 04/Dec/14

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: