[DDC-2169] [GH-524] EntityManagerDecorator base class as an extension point for EntityManager Created: 26/Nov/12  Updated: 24/Apr/14  Resolved: 04/May/13

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

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


 Description   

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

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

Message:

As discussed on IRC. Open issues to be discussed:



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

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

Comment by Doctrine Bot [ 24/Apr/14 ]

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





[DDC-2202] [GH-538] IDENTITY() Support composite primary key Created: 16/Dec/12  Updated: 24/Apr/14  Resolved: 24/Dec/12

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

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


 Description   

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

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

Message:

This patch add support for composite primary key to identity function



 Comments   
Comment by Benjamin Eberlei [ 24/Dec/12 ]

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

Comment by Doctrine Bot [ 24/Apr/14 ]

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





[DDC-2270] [GH-563] DDC-2268 - Regression test Created: 02/Feb/13  Updated: 24/Apr/14  Resolved: 02/Feb/13

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

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


 Description   

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

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

Message:

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

Not sure when, but it is already fixed in master.



 Comments   
Comment by Benjamin Eberlei [ 02/Feb/13 ]

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

Comment by Fabio B. Silva [ 02/Feb/13 ]

merged : https://github.com/doctrine/doctrine2/commit/1627fc95965a3e2e3894fcf7e524eb0eaa9d0ddd

Comment by Doctrine Bot [ 24/Apr/14 ]

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





[DDC-2273] [GH-566] Added missing return statement to AbstractCommand. Created: 03/Feb/13  Updated: 22/Apr/14  Resolved: 05/Feb/13

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

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


 Description   

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

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

Message:

The `AbstractCommand::execute()` method should return an `integer`, or `null`.

Although in PHP, omitting the `return` statement is equivalent to returning `null`, it is recommended to put an explicit `return` to clearly differentiate it from `return void`.

I've added `return 0;` here, keeping the existent behavior.



 Comments   
Comment by Benjamin Eberlei [ 03/Feb/13 ]

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

Comment by Fabio B. Silva [ 05/Feb/13 ]

Merged : https://github.com/doctrine/doctrine2/commit/d3cbdfcafa3e8dbb1d3f7029f31eb6412855c097

Comment by Doctrine Bot [ 22/Apr/14 ]

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





[DDC-2276] [GH-569] Hotfix/pre flush event args params Created: 04/Feb/13  Updated: 18/Apr/14  Resolved: 12/Feb/13

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

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


 Description   

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

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

Message:

As reported by a user on IRC, the `PreFlushEventArgs` object was built with incorrect parameters. this fix solves the problem by typehinting the constructor.

Tests aren't really necessary since a lot of functional tests were simply broken because of this additional typehint.



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

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

Comment by Fabio B. Silva [ 12/Feb/13 ]

Merged : https://github.com/doctrine/doctrine2/commit/719031f2effd2074d94c709b6b7311fb0773fb7f

Comment by Doctrine Bot [ 18/Apr/14 ]

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





[DDC-2274] [GH-567] Removed outdated methods in DatabasePlatformMock Created: 03/Feb/13  Updated: 17/Apr/14  Resolved: 05/Feb/13

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

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


 Description   

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

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

Message:

`DatabasePlatformMock::getNativeDeclaration()` and `getPortableDeclaration()` do not override an existing method in `AbstractPlatform`.
I guess they are leftovers of a previous version, and should be removed.



 Comments   
Comment by Benjamin Eberlei [ 03/Feb/13 ]

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

Comment by Fabio B. Silva [ 05/Feb/13 ]

merged : https://github.com/doctrine/doctrine2/commit/ef1ed588b5db6f87399772f953bf8b6dc4d2556d

Comment by Doctrine Bot [ 17/Apr/14 ]

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





[DDC-2272] [GH-565] Removed an unused local variable. Created: 03/Feb/13  Updated: 13/Apr/14  Resolved: 05/Feb/13

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

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


 Description   

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

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

Message:

This PR removes an unused (redundant) local variable declaration.



 Comments   
Comment by Benjamin Eberlei [ 03/Feb/13 ]

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

Comment by Fabio B. Silva [ 05/Feb/13 ]

Merged : https://github.com/doctrine/doctrine2/commit/114827a4b32fe309519cf3f9bdfedb3599d52f37

Comment by Doctrine Bot [ 13/Apr/14 ]

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





[DDC-2687] Paginator with ORDER BY not working in MSSQL Created: 18/Sep/13  Updated: 04/Apr/14  Resolved: 12/Jan/14

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

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

Symfony 2.3, SQL Server 2008 R2



 Description   

This bug report is similar to this one:
http://www.doctrine-project.org/jira/browse/DDC-2622

It's decided to make a new bug report to keep things cleaner (commits have already been done on the other report).

PHP code to test (A symfony 2.3 controller):

Unable to find source-code formatter for language: php. Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml
<?php
public function testAction() {
	$em = $this->getDoctrine()->getManager();
	$query = $em->createQuery("
		SELECT report, user
		FROM Report:Report report

		JOIN report.user user

		WHERE user.id = ?1
		ORDER BY report.created DESC
	");
	$query->setMaxResults(10);
	$query->setParameter(1, 1);
	$paginator = new Paginator($query, $fetchJoinCollection = true);
	$result = $paginator->getIterator(); // Trigger querying, using paginator
	//$result = $query->getResult();

	return [
		'var' => $result
	];
}
// returning the result to a template debug function

Schema:
One User to Many Reports

SQL + ERROR:

An exception occurred while executing '
SELECT *
FROM (
	SELECT DISTINCT id0
		,ROW_NUMBER() OVER (
			ORDER BY r0_.aangemaakt DESC
			) AS doctrine_rownum
	FROM (
		SELECT r0_.id AS id0
			,r0_.Naam AS Naam1
			,r0_.Omschrijving AS Omschrijving2
			,r0_.aangemaakt AS aangemaakt3
			,r0_.gewijzigd AS gewijzigd4
			,r0_.verwijderd AS verwijderd5
			,g1_.username AS username6
			,g1_.username_canonical AS username_canonical7
			,g1_.email AS email8
			,g1_.email_canonical AS email_canonical9
			,g1_.enabled AS enabled10
			,g1_.salt AS salt11
			,g1_.password AS password12
			,g1_.last_login AS last_login13
			,g1_.locked AS locked14
			,g1_.expired AS expired15
			,g1_.expires_at AS expires_at16
			,g1_.confirmation_token AS confirmation_token17
			,g1_.password_requested_at AS password_requested_at18
			,g1_.roles AS roles19
			,g1_.credentials_expired AS credentials_expired20
			,g1_.credentials_expire_at AS credentials_expire_at21
			,g1_.id AS id22
		FROM Rapporten r0_ WITH (NOLOCK)
		INNER JOIN Gebruiker g1_ ON r0_.GebruikerId = g1_.id
		WHERE (g1_.id = ?)
			AND (r0_.verwijderd IS NULL)
		) dctrn_result
	) AS doctrine_tbl
WHERE doctrine_rownum BETWEEN 1
		AND 10
' with params [1]:

SQLSTATE[42000]: [Microsoft][SQL Server Native Client 11.0][SQL Server]The multi-part identifier "r0_.aangemaakt" could not be bound. 

FIX:
Change

ORDER BY r0_.aangemaakt DESC

to

ORDER BY aangemaakt3 DESC

This fix should only be applied in case of the Paginator scenario, which looks like this:

Unable to find source-code formatter for language: php. Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml
	$paginator = new Paginator($query, $fetchJoinCollection = true);
	$result = $paginator->getIterator(); // Trigger querying, using paginator
	//$result = $query->getResult();

When getting a normal result, like this:

Unable to find source-code formatter for language: php. Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml
	//$paginator = new Paginator($query, $fetchJoinCollection = true);
	//$result = $paginator->getIterator(); // Trigger querying, using paginator
	$result = $query->getResult();

it works fine without any problems.

The "normal" result should keep working correctly!

The SQL produced by the non-paginator result:

FROM (
	SELECT r0_.id AS id0
		,r0_.Naam AS Naam1
		,r0_.Omschrijving AS Omschrijving2
		,r0_.aangemaakt AS aangemaakt3
		,r0_.gewijzigd AS gewijzigd4
		,r0_.verwijderd AS verwijderd5
		,g1_.username AS username6
		,g1_.username_canonical AS username_canonical7
		,g1_.email AS email8
		,g1_.email_canonical AS email_canonical9
		,g1_.enabled AS enabled10
		,g1_.salt AS salt11
		,g1_.password AS password12
		,g1_.last_login AS last_login13
		,g1_.locked AS locked14
		,g1_.expired AS expired15
		,g1_.expires_at AS expires_at16
		,g1_.confirmation_token AS confirmation_token17
		,g1_.password_requested_at AS password_requested_at18
		,g1_.roles AS roles19
		,g1_.credentials_expired AS credentials_expired20
		,g1_.credentials_expire_at AS credentials_expire_at21
		,g1_.id AS id22
		,r0_.GebruikerId AS GebruikerId23
		,g1_.group_id AS group_id24
		,ROW_NUMBER() OVER (
			ORDER BY r0_.aangemaakt DESC
			) AS doctrine_rownum
	FROM Rapporten r0_ WITH (NOLOCK)
	INNER JOIN Gebruiker g1_ ON r0_.GebruikerId = g1_.id
	WHERE (g1_.id = ?)
		AND (r0_.verwijderd IS NULL)
	) AS doctrine_tbl
WHERE doctrine_rownum BETWEEN 1
		AND 10

Notice

ORDER BY r0_.aangemaakt DESC

this is correct!

The difference is that the Paginator wraps the query in in a query with distinct, this is done here:
https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php#L160

So far i know two different solutions.

1.
Detect the wrapping query in SQLServerPlatform::doModifyLimitQuery with regex. See relevant code snippet below

Unable to find source-code formatter for language: php. Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml
if (preg_match('/SELECT DISTINCT .* FROM \(.*\) dctrn_result/', $query)) {
		$isWrapped = true;
} else {
		$isWrapped = false;
}

//Find alias for each colum used in ORDER BY
if ( ! empty($orderbyColumns)) {
		foreach ($orderbyColumns as $column) {

				if ($isWrapped) {
						$pattern    = sprintf('/%s\.%s\s+(AS\s+)?([^,\s\)]+)/i', $column['table'], $column['column']);
						$overColumn = preg_match($pattern, $query, $matches) ? $matches[2] : $column['column'];
				} else {
						$pattern    = sprintf('/%s\.(%s)\s*(AS)?\s*([^,\s\)]*)/i', $column['table'], $column['column']);
						$overColumn = preg_match($pattern, $query, $matches)
								? ($column['hasTable'] ? $column['table']  . '.' : '') . $column['column'] 
								: $column['column'];
				}

				if (isset($column['sort'])) {
						$overColumn .= ' ' . $column['sort'];
				}

				$overColumns[] = $overColumn;
		}
}

This code would replace:
https://github.com/doctrine/dbal/blob/master/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php#L856-L870
And takes two lines of codes from this commit:
https://github.com/doctrine/dbal/blob/5d7bcb6637646eb1daf6d90827233f5562cbda29/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php#L860-L861

Another solution is that the Paginator should be responsible for notifying the SQLServerPlatform::doModifyLimitQuery method if the query is wrapped or not. In that case, this line of code
https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php#L171
should be replaced by

Unable to find source-code formatter for language: php. Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml
$sql, $this->maxResults, $this->firstResult, true

And this line of code:
https://github.com/doctrine/dbal/blob/master/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php#L818
should be replaced by

Unable to find source-code formatter for language: php. Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml
protected function doModifyLimitQuery($query, $limit, $offset = null, $isWrapped = false)

Of course parts of the code from the previous solution are still needed. But the $isWrapped detection is not done anymore by regex this way.



 Comments   
Comment by Flip [ 18/Sep/13 ]

I ran the full doctrine orm testsuite on a SQL Server 2008 R2 database. A before and after the first suggested bug fix has been applied. Tests results showed no difference at all. This means:
1. The change does not break any other stuff
2. There is no test yet to cover this case

Comment by Flip [ 12/Jan/14 ]

solved bug, can be closed. See: https://github.com/doctrine/dbal/pull/383

Comment by Marco Pivetta [ 12/Jan/14 ]

Merged: https://github.com/doctrine/dbal/commit/b4bcc18fe0d1b99e37ad51a4a25a04a83ab9d99a

Comment by Doctrine Bot [ 04/Apr/14 ]

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





[DDC-2622] Paginator with ORDER BY not working in MSSQL Created: 20/Aug/13  Updated: 04/Apr/14  Resolved: 12/Jan/14

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

Type: Bug Priority: Major
Reporter: Flip Assignee: Marco Pivetta
Resolution: Duplicate Votes: 0
Labels: None
Environment:

SQL Server 2008 R2, Symfony 2.3 FOS User Bundle



 Description   

PHP code to test (A symfony 2.3 controller):

<?php
public function testAction() {
	$em = $this->getDoctrine()->getManager();
	$query = $em->createQuery("
		SELECT report, user
		FROM Report:Report report
		
		JOIN report.user user

		WHERE user.id = ?1
		ORDER BY report.created DESC
	");
	$query->setMaxResults(10);
	$query->setParameter(1, 1);
	$results = new Paginator($query, $fetchJoinCollection = true);
	foreach ($results as $result) {}; // This was needed to trigger the query o_O

	return new Response();
}

Schema:
One User to Many Reports

SQL + ERROR:

An exception occurred while executing '
SELECT *
FROM (
	SELECT DISTINCT id0
		,ROW_NUMBER() OVER (
			ORDER BY r0_.aangemaakt DESC
			) AS doctrine_rownum
	FROM (
		SELECT r0_.id AS id0
			,r0_.Naam AS Naam1
			,r0_.Omschrijving AS Omschrijving2
			,r0_.aangemaakt AS aangemaakt3
			,r0_.gewijzigd AS gewijzigd4
			,r0_.verwijderd AS verwijderd5
			,g1_.username AS username6
			,g1_.username_canonical AS username_canonical7
			,g1_.email AS email8
			,g1_.email_canonical AS email_canonical9
			,g1_.enabled AS enabled10
			,g1_.salt AS salt11
			,g1_.password AS password12
			,g1_.last_login AS last_login13
			,g1_.locked AS locked14
			,g1_.expired AS expired15
			,g1_.expires_at AS expires_at16
			,g1_.confirmation_token AS confirmation_token17
			,g1_.password_requested_at AS password_requested_at18
			,g1_.roles AS roles19
			,g1_.credentials_expired AS credentials_expired20
			,g1_.credentials_expire_at AS credentials_expire_at21
			,g1_.id AS id22
		FROM Rapporten r0_ WITH (NOLOCK)
		INNER JOIN Gebruiker g1_ ON r0_.GebruikerId = g1_.id
		WHERE (g1_.id = ?)
			AND (r0_.verwijderd IS NULL)
		) dctrn_result
	) AS doctrine_tbl
WHERE doctrine_rownum BETWEEN 1
		AND 10
' with params [1]:

SQLSTATE[42000]: [Microsoft][SQL Server Native Client 11.0][SQL Server]The multi-part identifier "r0_.aangemaakt" could not be bound. 

FIX:
Change

ORDER BY r0_.aangemaakt DESC

to

ORDER BY aangemaakt3 DESC


 Comments   
Comment by Flip [ 20/Aug/13 ]

I didn't get the Paginator working yet, but as i understand this is the first of 3 (maybe 2) queries, as described here: http://docs.doctrine-project.org/en/latest/tutorials/pagination.html It seems that in this first query it's not necessary to SELECT all these columns, so there is an opportunity here for a performance boost when not selecting them. (They still have to be selected in the final query to get the results).

Comment by Marco Pivetta [ 15/Sep/13 ]

Just a note: the DQL query you're doing here is very dangerous hydration-wise. Don't ever filter on fetch-joined results.

Comment by Marco Pivetta [ 15/Sep/13 ]

Provided patches at https://github.com/doctrine/doctrine2/pull/789 and https://github.com/doctrine/dbal/pull/371

Comment by Flip [ 16/Sep/13 ]

I don't understand your comment about filtering on fetch-join results being dangerous for hydration, could you please elaborate?

Comment by Marco Pivetta [ 16/Sep/13 ]

Flip it's unrelated to this change. I'd just explain that on IRC to avoid cluttering the issue here.

Comment by Doctrine Bot [ 16/Sep/13 ]

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

Comment by Flip [ 12/Jan/14 ]

Can be closed in favor of http://www.doctrine-project.org/jira/browse/DDC-2687

Comment by Marco Pivetta [ 12/Jan/14 ]

Handled in DDC-2687

Comment by Doctrine Bot [ 04/Apr/14 ]

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





[DDC-1106] Wrong inversedBy in example Created: 07/Apr/11  Updated: 01/Apr/14  Resolved: 01/Apr/14

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

Type: Documentation Priority: Major
Reporter: cristobal castro Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None

Attachments: Zip Archive screen-shot.zip    

 Description   

on page http://www.doctrine-project.org/docs/orm/2.0/en/reference/working-with-objects.html
section : 8.1. Association Example Entities, first example. Please see the .jpg in attachement(it explains clearly what I think is an error)
Regards.



 Comments   
Comment by Steve Müller [ 01/Apr/14 ]

Fixed in commit: https://github.com/doctrine/doctrine2/commit/10c48bad7b79af84855f7c63590f1f426770ed6b





[DDC-1180] Indexed Associations: foreign key (association) cannot be used as indexBy field Created: 29/May/11  Updated: 01/Apr/14  Resolved: 01/Apr/14

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

Type: Improvement Priority: Major
Reporter: Petr Sobotka Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 3
Labels: None
Environment:

Using Doctrine ORM 2.1.0BETA1



 Description   

I am trying to index a collection by its entity's column which is also a foreign key (association). It seems to me that it is not possible at the moment.

For example:

/**
 * @Entity
 */
class Hotel
{

    // $id column and other stuff

    /**
     * @oneToMany(targetEntity="Booking", mappedBy="hotel", indexBy="room")
     * @var Booking[]
     */
    private $bookings;
}

/**
 * @Entity
 */
class Booking
{
    /**
     * @var Hotel
     *
     * @Id 
     * @ManyToOne(targetEntity="Hotel", inversedBy="bookings")
     * @JoinColumns({
     *   @JoinColumn(name="hotel_id", referencedColumnName="id")
     * })
     */
    private $hotel;

    /**
     * @var Room
     *
     * @Id
     * @ManyToOne(targetEntity="Room")
     * @JoinColumns({
     *   @JoinColumn(name="room_id", referencedColumnName="id")
     * })
     */
    private $room;
}

Only possible workaround I found is to define another (plain) entity's property mapped to the same table column and index by it:

/**
 * @Entity
 */
class Hotel
{

    // $id column and other stuff

    /**
     * @oneToMany(targetEntity="Booking", mappedBy="hotel", indexBy="roomId")
     * @var Booking[]
     */
    private $bookings;
}

/**
 * @Entity
 */
class Booking
{
    // ...

    /**
     * @var Room
     *
     * @Id
     * @ManyToOne(targetEntity="Room")
     * @JoinColumns({
     *   @JoinColumn(name="room_id", referencedColumnName="id")
     * })
     */
    private $room;
    
    /**
     * @var integer $roomId
     *
     * @Column(name="room_id", type="integer", nullable=false)
     */
    private $roomId;
}

Wouldn't it be easy to support it?



 Comments   
Comment by Benjamin Eberlei [ 05/Jun/11 ]

It is not so easy to implement from the first gimplse and it is not a bug but an improvement/feature request.

Comment by Benjamin Morel [ 02/Mar/13 ]

Related PR: https://github.com/doctrine/doctrine2/pull/204

Comment by Benjamin Morel [ 30/Mar/14 ]

This seems to have been integrated now:
https://github.com/doctrine/doctrine2/pull/639

Should this be marked as resolved?

Comment by Petr Sobotka [ 01/Apr/14 ]

Resolved. Thanks!





[DDC-2262] [GH-559] [Paginator] Added support for order by scalar Created: 26/Jan/13  Updated: 01/Apr/14  Resolved: 27/Jan/13

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

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


 Description   

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

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

Message:



 Comments   
Comment by Benjamin Eberlei [ 27/Jan/13 ]

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

Comment by Doctrine Bot [ 01/Apr/14 ]

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





[DDC-2266] [GH-562] Fix error in QueryBuilder example Created: 30/Jan/13  Updated: 01/Apr/14  Resolved: 05/Feb/13

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

Type: Documentation Priority: Trivial
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:



 Comments   
Comment by Benjamin Eberlei [ 02/Feb/13 ]

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

Comment by Fabio B. Silva [ 05/Feb/13 ]

Merged : https://github.com/doctrine/doctrine2/commit/4651d92d634784d5d8d02af378afccb74935058c

Comment by Doctrine Bot [ 01/Apr/14 ]

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





[DDC-2215] [GH-543] Make doctrine a Light-weight distribution package in Composer Created: 28/Dec/12  Updated: 14/Mar/14  Resolved: 19/Jan/13

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

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


 Description   

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

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

Message:

In order to save space and bandwidth when installing doctrine using Composer, I have added .gitattributes removing files and folders unnecessary when using doctrine as a dependecy.

(extracted from http://getcomposer.org/doc/02-libraries.md#light-weight-distribution-packages)

Including the tests and other useless information like .travis.yml in distributed packages is not a good idea.

The .gitattributes file is a git specific file like .gitignore also living at the root directory of your library. It overrides local and global configuration (.git/config and ~/.gitconfig respectively) when present and tracked by git.

Use .gitattributes to prevent unwanted files from bloating the zip distribution packages.

// .gitattributes
/Tests export-ignore
phpunit.xml.dist export-ignore
Resources/doc/ export-ignore
.travis.yml export-ignore
Test it by inspecting the zip file generated manually:

git archive branchName --format zip -o file.zip

Note: Files would be still tracked by git just not included in the distribution. This will only work for GitHub packages installed from dist (i.e. tagged releases) for now.



 Comments   
Comment by Doctrine Bot [ 14/Mar/14 ]

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





[DDC-2486] Getting started does not work with current release Created: 04/Jun/13  Updated: 12/Mar/14  Resolved: 11/Sep/13

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

Type: Documentation Priority: Minor
Reporter: Julian Picht Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 1
Labels: Cli
Environment:

Ubuntu 12.04



 Description   

The tutorial states: "This tutorial assumes you work with Doctrine 2.3 and above. Some of the code will not work with lower versions."

I'm using 2.3.4

When running "php vendor/bin/doctrine orm:schema-tool:create"

this happens:

PHP Fatal error: Call to undefined method Doctrine\ORM\Tools\Console\ConsoleRunner::createHelperSet() in /var/www/project/cli-config.php on line 5
PHP Stack trace:
PHP 1.

{main}() /var/www/project/vendor/doctrine/orm/bin/doctrine:0
PHP 2. include() /var/www/project/vendor/doctrine/orm/bin/doctrine:4
PHP 3. require() /var/www/project/vendor/doctrine/orm/bin/doctrine.php:31

Fatal error: Call to undefined method Doctrine\ORM\Tools\Console\ConsoleRunner::createHelperSet() in /var/www/project/cli-config.php on line 5

Call Stack:
0.0001 619840 1. {main}

() /var/www/project/vendor/doctrine/orm/bin/doctrine:0
0.0003 632072 2. include('/var/www/project/vendor/doctrine/orm/bin/doctrine.php') /var/www/project/vendor/doctrine/orm/bin/doctrine:4
0.0012 730208 3. require('/var/www/project/cli-config.php') /var/www/project/vendor/doctrine/orm/bin/doctrine.php:31

This is because some commits are not yet in the release. The current GIT version probably works but is not an option for me.



 Comments   
Comment by Benton Jackson [ 11/Jun/13 ]

I'm seeing this problem too. Kinda hard to learn Doctrine when the tutorial is brain dead.

Comment by Benton Jackson [ 11/Jun/13 ]

"CreateHelperSet" appears to be a method in 2.4. I adapted the "2.3 configuring the command line" code to make my "cli-config.php" file read like this, and it appears to work:

<?php
// cli-config.php
require_once "bootstrap.php";

$em = $entityManager;

$helperSet = new \Symfony\Component\Console\Helper\HelperSet(array(
'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getConnection()),
'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em)
));

Comment by Stephen Westman [ 23/Jun/13 ]

Thanks to Benton, I now have a working Doctrine app. I agree that it would be nice to have had this taken care of before release. However, as an old time guerrilla-type programmer, I can do "whatever works"!

Thanks again, Benton!

Comment by Mortensen Cristian [ 25/Aug/13 ]

Thanks Benton!

Comment by Benjamin Eberlei [ 11/Sep/13 ]

2.4 is now released and the tutorial works, sorry for the long disconnect

Comment by Vishal Bandre [ 03/Mar/14 ]

My working cli-config.php with latest fresh doctrine source as on Mar 03 2014.

Windows XP - Access doctrine without using php command like > vendor\bin\doctrine.

<?php // cli-config.php
use Doctrine\ORM\Tools\Console\ConsoleRunner;

// replace with file to your own project bootstrap
require_once 'bootstrap.php';

// replace with mechanism to retrieve EntityManager in your app
// $entityManager = GetEntityManager();

$em = $entityManager;
$helperSet = new \Symfony\Component\Console\Helper\HelperSet(array(
'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getConnection()),
'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em)
));
return ConsoleRunner::createHelperSet($em);

Comment by Igor Timoshenkov [ 11/Mar/14 ]

Hello, everyone.

I am trying to follow the Tutorial, but I am stuck with the cli generation. Here is my cli-config.php file:

<?php
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Tools\Console\ConsoleRunner;
use Doctrine\ORM\Tools\Setup;

require_once "vendor/autoload.php";

$modelsPath = realpath(_DIR_.'/../model');
$config = Setup::createAnnotationMetadataConfiguration(array($modelsPath), true);

// database configuration parameters
$conn = array(
'driver' => 'pdo_sqlite',
'host' => 'localhost',
'user' => 'root',
'password' => '',
'dbname' => 'someDb',
);

return ConsoleRunner::createHelperSet(EntityManager::create($conn, $config));

Now, when I run

php vendor/bin/doctrine orm:schema-tool:create
or
php vendor/bin/doctrine orm:schema-tool:drop

I get Access denied. What am I doing wrong?

P.S. I am not using Symfony, Doctrine version is 2.4.1.

Comment by Vishal Bandre [ 12/Mar/14 ]

Which db driver are you using?

If you are using sqlite the conn parameters to be used are user, password, path, memory as described on http://docs.doctrine-project.org/projects/doctrine-dbal/en/2.0.x/reference/configuration.html but your connection array is showing wrong settings (these are MYSQL specific). Please check required db driver and try again.

Comment by Marco Pivetta [ 12/Mar/14 ]

Igor Timoshenkov's question was solved at http://stackoverflow.com/q/22336256/347063

Basically, his vendor/bin/doctrine was broken, but running php vendor/doctrine/orm/bin/doctrine worked fine.

Comment by Igor Timoshenkov [ 12/Mar/14 ]

Hi, guys.

Igor Timoshenkov's question was solved at http://stackoverflow.com/q/22336256/347063

My question is not solved.

If you are using sqlite the conn parameters to be used are user, password, path, memory as described on http://docs.doctrine-project.org/projects/doctrine-dbal/en/2.0.x/reference/configuration.html but your connection array is showing wrong settings (these are MYSQL specific). Please check required db driver and try again.

I have corrected the configuration parameters - I needed pdo_mysql, not pdo_sqlite. But the php vendor/bin/doctrine orm:schema-tool:create is still not working. Any ideas what else could that be?

BTW, the link to the configuration should be added to the Tutorial.

Comment by Vishal Bandre [ 12/Mar/14 ]

Will you please share/paste full error message here?

Check for missing db password, etc.





[DDC-2198] [GH-536] add missed branch Created: 14/Dec/12  Updated: 07/Mar/14  Resolved: 16/Dec/12

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

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


 Description   

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

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

Message:



 Comments   
Comment by Benjamin Eberlei [ 16/Dec/12 ]

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

Comment by Doctrine Bot [ 07/Mar/14 ]

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





[DDC-2187] [GH-531] use base events Created: 05/Dec/12  Updated: 21/Feb/14  Resolved: 24/Dec/12

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

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


 Description   

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

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

Message:

in consequence of https://github.com/doctrine/common/pull/222



 Comments   
Comment by Doctrine Bot [ 21/Feb/14 ]

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





[DDC-2506] WITH Conditionals on Class Table Inheritance LEFT JOINs are inserted incorrectly Created: 14/Jun/13  Updated: 17/Feb/14  Resolved: 20/Aug/13

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

Type: Bug Priority: Major
Reporter: Matt Janssen Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 2
Labels: dql, inheritance, joins, sql-walker


 Description   

The following JOIN

JOIN c.ctiRelationship cti WITH cti.id IN (42)

generates unexpected SQL

LEFT JOIN class_base p1_ ON u1_.cti_id = p1_.id 
LEFT JOIN class_child1 p2_ ON p1_.id = p2_.id
LEFT JOIN class_child2 p3_ ON p1_.id = p3_.id AND (p1_.id IN (42)) 

when it SHOULD be generating

LEFT JOIN class_base p1_ ON u1_.cti_id = p1_.id AND (p1_.id IN (42)) 
LEFT JOIN class_child1 p2_ ON p1_.id = p2_.id
LEFT JOIN class_child2 p3_ ON p1_.id = p3_.id


 Comments   
Comment by Matt Janssen [ 14/Jun/13 ]

https://github.com/doctrine/doctrine2/pull/708

Comment by gseric [ 01/Jul/13 ]

Thanks Matt, this bug prevented me to upgrade to 2.3. BTW it was originally reported in DDC-2131 (I put a comment there to redirect users here).

Comment by Gordon Forsythe [ 03/Jul/13 ]

I've tested this PR and it does work.

Comment by Doctrine Bot [ 13/Aug/13 ]

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

Comment by Doctrine Bot [ 17/Feb/14 ]

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





[DDC-2092] [GH-487] Fix DDC-2069 Created: 20/Oct/12  Updated: 16/Feb/14  Resolved: 08/Sep/13

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

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


 Description   

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

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

Message:

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



 Comments   
Comment by Benjamin Eberlei [ 21/Oct/12 ]

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

Comment by Fabio B. Silva [ 21/Oct/12 ]

Merged

Comment by Doctrine Bot [ 16/Feb/14 ]

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





[DDC-1998] Problem when deleting with EntityManager->remove($entity) Created: 28/Aug/12  Updated: 15/Feb/14  Resolved: 01/May/13

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

Type: Bug Priority: Minor
Reporter: victor Velkov Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None

Attachments: File DDC1998Test.php     File DDC1998Test1.php     File EwtTimestamp.php     File ProductTemplate.php    
Issue Links:
Duplicate
is duplicated by DDC-2176 Illegal offset type in isset or empty... Resolved

 Description   

The problem is when using EntityMamager->remove($entity). The Sql query generated doesn't convert the values of the ids according to the field type that is used in doc block annotation. After investigating I found that in Doctrine\DBAL\Connection the function delete doesn't support to receive as param the types of the ids to be given to the executeUpdate function which is called in it and supports them. (The types need to be provided from the persisters from which the delete is called).

I hope it make sense to you. I got that problem because I am using custom time stamp column type as id. And it converts the value of the field to time stamp string, which if not converted to the proper sql value is not recognised and the delete doesn't go trough.

As far as I can see it is something that was missed and hope it will be fixed soon.

If you have any questions please ask.
Also on request I can provide example code and the fix I have done for myself.



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

Hi Victor

Could you attach/paste your custom type and entity please ?

Comment by victor Velkov [ 30/Aug/12 ]

Ok I have attached them. The EwtTimestamp is the custom type.

Comment by Marco Pivetta [ 17/Sep/12 ]

victor Velkov do you have a failing test case for this one?

Comment by victor Velkov [ 17/Sep/12 ]

Nope sorry haven't done any test cases for this one

Comment by Fabio B. Silva [ 23/Sep/12 ]

Hi Victor,

I can't reproduce, could you change the added test case and try to make it fails ?

Thanks

Comment by victor Velkov [ 26/Sep/12 ]

Sure will do it as soon as I can. Sorry I didn't answer sooner just was in a holiday

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

Thanks Victor

Please let me know when you change the test

Comment by victor Velkov [ 02/Oct/12 ]

Sorry for the delay i have attached the test case (DDC1998Test1.php).

Comment by Fabio B. Silva [ 10/Oct/12 ]

Hi Victor,

Sorry for the delay to answer

I think that we can't fix it,
Your type requires sql conversion to work, and doctrine does not support @Id fields with sql conversion.

Comment by victor Velkov [ 11/Oct/12 ]

Really as far as i can see in the code you do convert them when you are executing an update. And the fix that i did for my self is to add 3rd parameter to the function delete in Doctrine\DBAL\Connection and then every where where it is called in the code which is in 2 places Doctrine\ORM\Persisters\BasicEntityPersister and Doctrine\ORM\JoinedSubclassPersister to give that parameter with the types. And as far as i can see you do that for the updates. After that in Connection delete you call the executeUpdate which supports the type and you just have to pass it along. And that is it.

Comment by Marco Pivetta [ 23/Jan/13 ]

Reducing priority. It is an edge case, and we already don't officially support custom object types as identifiers.

Comment by Benjamin Eberlei [ 01/May/13 ]

We should be able to support this I think, i don't see a reason it shouldnt work

Comment by Benjamin Eberlei [ 01/May/13 ]

Will be fixed in 2.4





[DDC-2181] [GH-528] Documentation fixes Created: 01/Dec/12  Updated: 14/Feb/14  Resolved: 23/Dec/12

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

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


 Description   

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

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

Message:

This is a first batch of documentation fixes:

  • Missing docblocks
  • Missing / incorrect `@param` / `@return` / `@throws` annotations
  • Missing newlines between annotations
  • Incorrect vertical alignment of `@param` annotations

I'm willing to make more documentation fixes on this project, but I'll wait for your feedback on this first batch before moving forward!

Let me know if you have any comment / suggestion / question.



 Comments   
Comment by Doctrine Bot [ 14/Feb/14 ]

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





[DDC-2174] [GH-526] [DDC-2172] Fix EntityGenerator get literal type Created: 27/Nov/12  Updated: 11/Feb/14  Resolved: 27/Nov/12

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

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


 Description   

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

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

Message:

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



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

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

Comment by Fabio B. Silva [ 27/Nov/12 ]

Merged : https://github.com/doctrine/doctrine2/commit/29f0b678cfb991e90af3eed023fb8c62ec8f7acf

Comment by Doctrine Bot [ 11/Feb/14 ]

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





[DDC-2151] [GH-515] Fixes sandbox cli: The helper "em" is not defined. Created: 16/Nov/12  Updated: 08/Feb/14  Resolved: 25/Nov/12

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

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


 Description   

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

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

Message:

In afd8ea9 $helpers became an instance of HelperSet and caused an "The helper "em" is not defined." exception.



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

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

Comment by Doctrine Bot [ 08/Feb/14 ]

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





[DDC-2127] [GH-506] Fix DDC-2121 Created: 06/Nov/12  Updated: 08/Feb/14  Resolved: 06/Nov/12

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

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


 Description   

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

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

Message:

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



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

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

Comment by Fabio B. Silva [ 06/Nov/12 ]

Merged : https://github.com/doctrine/doctrine2/commit/262c3eea6bd4313d34558ff434bf9b8ff34b7ab3

Comment by Doctrine Bot [ 08/Feb/14 ]

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





[DDC-2132] [GH-509] SchemaTool ignoring 'fixed' option Created: 07/Nov/12  Updated: 08/Feb/14  Resolved: 12/Nov/12

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

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


 Description   

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

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

Message:

If the column is set to fixed string length like this:

```php
<?php

/**

  • @ORM\Column(type="string", length=2, options= {"fixed" = true}

    )
    */
    protected $foo;
    ```

The schema tool will not detect that 'fixed' option correctly when generating update SQL.

Fix attached.



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

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

Comment by Doctrine Bot [ 08/Feb/14 ]

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





[DDC-2142] [GH-513] Enumeration support Created: 13/Nov/12  Updated: 20/Jan/14  Resolved: 21/Nov/12

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

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


 Description   

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

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

Message:

This patch adds support for ``@Enum``. https://github.com/doctrine/common/pull/167

Please let me know if there is another annotations where we can use ``@Enum``.



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

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

Comment by Fabio B. Silva [ 21/Nov/12 ]

Merged : https://github.com/doctrine/common/commit/30b8cea3bfe22f5eb58b5b0165f21df750aeb2e2

Comment by Doctrine Bot [ 20/Jan/14 ]

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





[DDC-2679] SchemaTool ON DELETE CASCADE does not work with MSSQL Created: 13/Sep/13  Updated: 15/Jan/14

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

Type: Bug Priority: Major
Reporter: Flip Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None
Environment:

MSSQL 2008 R2



 Description   

The following queries are produced by:
vendor\doctrine\orm\tests\Doctrine\Tests\ORM\Functional\SchemaTool\DDC214Test.php

ALTER TABLE company_persons ADD CONSTRAINT FK_820EDD048EEC5B5C FOREIGN KEY (spouse_id) REFERENCES company_persons (id) ON DELETE CASCADE
ALTER TABLE company_persons_friends ADD CONSTRAINT FK_EAD47FE9217BBB47 FOREIGN KEY (person_id) REFERENCES company_persons (id) ON DELETE CASCADE
ALTER TABLE company_persons_friends ADD CONSTRAINT FK_EAD47FE96A5458E8 FOREIGN KEY (friend_id) REFERENCES company_persons (id) ON DELETE CASCADE
ALTER TABLE company_employees ADD CONSTRAINT FK_899949F0BF396750 FOREIGN KEY (id) REFERENCES company_persons (id) ON DELETE CASCADE
ALTER TABLE company_managers ADD CONSTRAINT FK_B1DEF56BBF396750 FOREIGN KEY (id) REFERENCES company_persons (id) ON DELETE CASCADE
ALTER TABLE company_auctions ADD CONSTRAINT FK_6A41FC6DBF396750 FOREIGN KEY (id) REFERENCES company_events (id) ON DELETE CASCADE
ALTER TABLE company_raffles ADD CONSTRAINT FK_9D157F46BF396750 FOREIGN KEY (id) REFERENCES company_events (id) ON DELETE CASCADE

The errors:

Msg 1785, Level 16, State 0, Line 1
Introducing FOREIGN KEY constraint 'FK_820EDD048EEC5B5C' on table 'company_persons' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints.
Msg 1750, Level 16, State 0, Line 1
Could not create constraint. See previous errors.
Msg 2714, Level 16, State 5, Line 1
There is already an object named 'FK_EAD47FE9217BBB47' in the database.
Msg 1750, Level 16, State 0, Line 1
Could not create constraint. See previous errors.
Msg 1785, Level 16, State 0, Line 1
Introducing FOREIGN KEY constraint 'FK_EAD47FE96A5458E8' on table 'company_persons_friends' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints.
Msg 1750, Level 16, State 0, Line 1
Could not create constraint. See previous errors.
Msg 2714, Level 16, State 5, Line 1
There is already an object named 'FK_899949F0BF396750' in the database.
Msg 1750, Level 16, State 0, Line 1
Could not create constraint. See previous errors.
Msg 2714, Level 16, State 5, Line 1
There is already an object named 'FK_B1DEF56BBF396750' in the database.
Msg 1750, Level 16, State 0, Line 1
Could not create constraint. See previous errors.
Msg 2714, Level 16, State 5, Line 1
There is already an object named 'FK_6A41FC6DBF396750' in the database.
Msg 1750, Level 16, State 0, Line 1
Could not create constraint. See previous errors.
Msg 2714, Level 16, State 5, Line 1
There is already an object named 'FK_9D157F46BF396750' in the database.
Msg 1750, Level 16, State 0, Line 1
Could not create constraint. See previous errors.

An explanation why this is happening:
http://stackoverflow.com/questions/851625/foreign-key-constraint-may-cause-cycles-or-multiple-cascade-paths



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

This is a SQL Server limitation as it does not support multi-path cascades for foreign keys.
See here: http://allyourdatabase.blogspot.de/2006/11/multiple-cascade-paths-error-in-sql.html

Not sure what to do about this at the moment...

Comment by Flip [ 15/Jan/14 ]

Yes there is nothing we can do to get this to work. But what we can do is:
1. Build in some detection when this happens and then throw a php exception for this kind of error (yet to be created)
2. All tests which rely on this functionality for SQL Server should be reviewed again. There are two possibilities:
A. The test can be rewritten so that it doesn't have multiple paths.
B. if not. The test has to be skipped for SQL Server.





[DDC-2137] [GH-510] CS on QueryBuilder Created: 12/Nov/12  Updated: 14/Jan/14  Resolved: 12/Nov/12

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

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


 Description   

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

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

Message:



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

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

Comment by Doctrine Bot [ 14/Jan/14 ]

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





[DDC-2124] [GH-503] added unsigned mapping to SchemaTool options Created: 05/Nov/12  Updated: 09/Jan/14  Resolved: 06/Nov/12

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

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


 Description   

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

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

Message:

Just checking in SchemaTool if unsigned option is set and take this value.



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

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

Comment by Fabio B. Silva [ 06/Nov/12 ]

Merged : https://github.com/doctrine/doctrine2/commit/863d14a61a825d0a14f23b19e7c26cc6c01b4a76

Comment by Doctrine Bot [ 09/Jan/14 ]

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





[DDC-2117] [GH-499] Speling: "invidiual" -> "individual" Created: 02/Nov/12  Updated: 07/Jan/14  Resolved: 05/Nov/12

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

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


 Description   

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

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

Message:

Just in a phpdoc comment, but should be corrected anyway.



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

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

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

Merged : https://github.com/doctrine/doctrine2/commit/409516e86c83d5e8ce42fc7960b27abbdeb8b29b

Comment by Doctrine Bot [ 07/Jan/14 ]

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





[DDC-2098] [GH-491] remove unused classes Created: 23/Oct/12  Updated: 05/Jan/14  Resolved: 24/Oct/12

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

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


 Description   

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

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

Message:

Hi,

This patch removes unused use statements.

Best regards,
Michal



 Comments   
Comment by Benjamin Eberlei [ 24/Oct/12 ]

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

Comment by Fabio B. Silva [ 24/Oct/12 ]

Merged : https://github.com/doctrine/doctrine2/commit/f5c1b38e2d03dd6428e9ceb3d27e6bba55a0f337

Comment by Doctrine Bot [ 05/Jan/14 ]

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





[DDC-2101] [GH-492] Added NOT LIKE expression Created: 25/Oct/12  Updated: 05/Jan/14  Resolved: 27/Oct/12

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

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


 Description   

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

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

Message:



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

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

Comment by Fabio B. Silva [ 27/Oct/12 ]

Merged : https://github.com/doctrine/doctrine2/commit/98c5b34f2b40fd04cf891052514f01f513077405

Comment by Doctrine Bot [ 05/Jan/14 ]

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





[DDC-2062] [GH-466] Use `protected` so EntityGenerator can be extended Created: 09/Oct/12  Updated: 05/Jan/14  Resolved: 12/Nov/12

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

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


 Description   

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

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

Message:

This is definitely something I'd like to be able to extend, and I imagine others might too.



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

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





[DDC-2108] [GH-493] Do not add trailing whitespace to blank lines Created: 30/Oct/12  Updated: 04/Jan/14  Resolved: 06/Nov/12

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

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


 Description   

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

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

Message:

This change prevents spaces from being added to blank lines so PHP Code Sniffer doesn't generate errors when using PSR2 standards.



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

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

Comment by Fabio B. Silva [ 06/Nov/12 ]

Merged : https://github.com/doctrine/doctrine2/commit/a44579303ca2a358d9e98127e158fc5fa5c5cb1e

Comment by Doctrine Bot [ 04/Jan/14 ]

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





[DDC-2094] [GH-488] Fix DDC-2079 Created: 20/Oct/12  Updated: 03/Jan/14  Resolved: 08/Sep/13

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

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


 Description   

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

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

Message:

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



 Comments   
Comment by Benjamin Eberlei [ 21/Oct/12 ]

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

Comment by Fabio B. Silva [ 21/Oct/12 ]

Merged

Comment by Doctrine Bot [ 03/Jan/14 ]

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





[DDC-2040] [GH-453] Added missing exit codes in commands Created: 24/Sep/12  Updated: 03/Jan/14  Resolved: 25/Oct/12

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

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


 Description   

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

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

Message:



 Comments   
Comment by Fabio B. Silva [ 25/Oct/12 ]

Closed in favor of https://github.com/doctrine/doctrine2/pull/489

Comment by Benjamin Eberlei [ 03/Nov/12 ]

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

Comment by Doctrine Bot [ 21/Dec/13 ]

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

Comment by Doctrine Bot [ 03/Jan/14 ]

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





[DDC-2095] [GH-489] Fixed coding standards in the Tools namespace Created: 22/Oct/12  Updated: 03/Jan/14  Resolved: 08/Sep/13

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

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


 Description   

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

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

Message:

This also fixes some command exit code in case of failure and removes an unused private method



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

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

Comment by Doctrine Bot [ 03/Jan/14 ]

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





[DDC-2097] [GH-490] fix StatementMock bindParam parameters Created: 22/Oct/12  Updated: 03/Jan/14  Resolved: 24/Oct/12

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

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


 Description   

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

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

Message:

Hi,

This patch fixes

PHP Fatal error: Declaration of Doctrine\Tests\Mocks\StatementMock::bindParam() must be compatible with Doctrine\DBAL\Driver\Statement::bindParam($column, &$variable, $type = NULL, $length = NULL) in /home/michal/projekty/doctrine2/tests/Doctrine/Tests/Mocks/StatementMock.php on line 11

Best regards,
Michal



 Comments   
Comment by Benjamin Eberlei [ 23/Oct/12 ]

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

Comment by Fabio B. Silva [ 24/Oct/12 ]

Merged : https://github.com/doctrine/doctrine2/commit/e9c7deae4fa95fd24e106d97a7c83bcf9d2faaed

Comment by Doctrine Bot [ 03/Jan/14 ]

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





[DDC-2091] [GH-486] Fix DDC-2084 Created: 20/Oct/12  Updated: 31/Dec/13  Resolved: 21/Nov/12

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

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


 Description   

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

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

Message:

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



 Comments   
Comment by Fabio B. Silva [ 21/Nov/12 ]

Merged : https://github.com/doctrine/doctrine2/commit/d6d5c341e220ff7aec50c8ecabd5d0b8be2e0804

Comment by Doctrine Bot [ 31/Dec/13 ]

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





[DDC-2083] [GH-482] user can set its own commands in the cli-config.php file Created: 16/Oct/12  Updated: 31/Dec/13  Resolved: 12/Nov/12

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

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


 Description   

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

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

Message:

Today we need to edit source to add custom commands. With this minor change, we can add custom commands directly in the cli-config.php file :

````
require_once "app/bootstrap.php";
$helperSet = new \Symfony\Component\Console\Helper\HelperSet(array(
'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($entityManager)
));

// example here
$commands = array(
new Doctrine\ORM\Tools\Console\Command\LoadDataCommand
);
````



 Comments   
Comment by Doctrine Bot [ 31/Dec/13 ]

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





[DDC-2056] [GH-462] [DDC-2055] Generate SELECT clause from ResultSetMappingBuilder Created: 03/Oct/12  Updated: 29/Dec/13  Resolved: 05/Oct/12

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

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


 Description   

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

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

Message:

Add support to generate entity result parts of the SELECT clause from a ResultSetMappingBuilder instance. Add support for column incrementing.

Sample:

public function testGenerateSelectClauseIncrement()

{ $rsm = new ResultSetMappingBuilder($this->_em); $rsm->addRootEntityFromClassMetadata('Doctrine\Tests\Models\CMS\CmsUser', 'u', ResultSetMappingBuilder::COLUMN_RENAMING_INCREMENT); $selectClause = $rsm->generateSelectClause(); $this->assertEquals('u.id AS id0, u.status AS status1, u.username AS username2, u.name AS name3, u.email_id AS email_id4', $selectClause); }

Restrictions:

This only generates the entity result clauses, not the ones for scalar results! Because we don't know what the scalar result actually means.



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

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

Comment by Doctrine Bot [ 29/Dec/13 ]

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





[DDC-2066] [GH-472] Fixed empty namespace in generated code when repository class do not have namespace Created: 11/Oct/12  Updated: 28/Dec/13  Resolved: 25/Oct/12

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

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


 Description   

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

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

Message:

When we defined a class without namespace for entity repository, just like @Entity(repositoryClass="BugRepository"), EntityRepositoryGenerator will generate the code like blow, which has error statement in namespace definition. So this is mainly added a generateEntityRepositoryNamespace method to generate the correct namespace.Just like what EntityGenerator does
https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Tools/EntityGenerator.php#L492

*before*
```php
<?php

namespace ; //caurse parse error: syntax error, unexpected ';', expecting T_STRING or T_NS_SEPARATOR or '{'

use Doctrine\ORM\EntityRepository;

/**

  • BugRepository
    *
  • This class was generated by the Doctrine ORM. Add your own custom
  • repository methods below.
    */
    class BugRepository extends EntityRepository
    {
    }
    ```
    *after*
    ```php
    <?php

use Doctrine\ORM\EntityRepository;

/**

  • BugRepository
    *
  • This class was generated by the Doctrine ORM. Add your own custom
  • repository methods below.
    */
    class BugRepository extends EntityRepository
    {
    }
    ````


 Comments   
Comment by Benjamin Eberlei [ 22/Oct/12 ]

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

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

Merged : https://github.com/doctrine/doctrine2/commit/a16a935bff27d42f0a308d4dfc11a555826310a7

Comment by Doctrine Bot [ 28/Dec/13 ]

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





[DDC-2054] [GH-461] [SchemaValidator] Fix typo Created: 03/Oct/12  Updated: 23/Dec/13  Resolved: 03/Oct/12

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

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


 Description   

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

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

Message:



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

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

Comment by Doctrine Bot [ 23/Dec/13 ]

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





[DDC-2047] [GH-456] Optimize autoload prefix in composer.json Created: 28/Sep/12  Updated: 22/Dec/13  Resolved: 05/Oct/12

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

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


 Description   

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

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

Message:

By having more specific autoload prefixes it is possible to reduce the number of stat calls made.



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

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

Comment by Doctrine Bot [ 22/Dec/13 ]

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





[DDC-2049] [GH-458] Use cascade=all if all cascade options set Created: 29/Sep/12  Updated: 22/Dec/13  Resolved: 05/Oct/12

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

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


 Description   

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

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

Message:

The YAML and XML metadata exporters output cascade=all if all five cascade options are set. The php and annotation exporter do not, they output cascade=list of all 5 cascades instead.

In order that all 4 exporters offer the same behavior, I updated the php and annotations exporters so that they export cascade=all



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

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

Comment by Doctrine Bot [ 22/Dec/13 ]

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





[DDC-2044] [GH-455] Fixed unique-constraint name in XML Exporter Created: 26/Sep/12  Updated: 22/Dec/13  Resolved: 05/Oct/12

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

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


 Description   

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

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

Message:



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

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

Comment by Doctrine Bot [ 22/Dec/13 ]

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





[DDC-1992] [GH-428] Add QueryBuilder::addCriteria() for Criteria - QueryBuilder bridge Created: 20/Aug/12  Updated: 22/Dec/13  Resolved: 25/Oct/12

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

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


 Description   

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

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

Message:

Simple implementation of Criteria to QueryBuilder conversion. Small step for Criteria integration without BC break.

Recreated from #426



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

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

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

Merged : https://github.com/doctrine/doctrine2/commit/267daa5fc1f5c4e7ada5b3f65db102bf52dbca67

Comment by Doctrine Bot [ 22/Dec/13 ]

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





[DDC-1996] [GH-429] Ensure a parameter mapping entry exists for InstanceOf DQL expressions Created: 22/Aug/12  Updated: 22/Dec/13  Resolved: 07/Jun/13

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

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


 Description   

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

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

Message:

Hi,

This is a possible fix for http://www.doctrine-project.org/jira/browse/DDC-1995, in that it resolves the issue for me but I'm afraid I haven't had time to test it extensively with more complex queries than the use case I gave in that ticket.

Cheers,
Craig



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

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

Comment by Fabio B. Silva [ 07/Jun/13 ]

Fixed by : https://github.com/doctrine/doctrine2/commit/462173ad71ae63cd9877e1e642f7968ed1f9971b

Comment by Doctrine Bot [ 22/Dec/13 ]

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





[DDC-2020] [GH-440] The schema tool now doesn't add a foreign constraint when subclassess of... Created: 08/Sep/12  Updated: 20/Dec/13  Resolved: 01/May/13

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

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


 Description   

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

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

Message:

... a STI use the same field to map relations with entities of different classes

It seems that there are no particular side-effects in mapping different relationship using the same table column name in different subclasses of a STI hierarchy.
Eg. Tag superclass of BookTag (id, object_id, comment) and MovieTag (id, object_id, comment), so having two attributes $book and $movie mapped to the same object_id field with @JoinColumn annotation

I wasn't sure about this so I tested to see if there were errors. And I was surprised that everything runs without any particular problem.
Moreover this is a really interesting (wanted? unwanted?) feature, very useful if you have huge tables that need to be joined with other table using the discriminator and object_id columns, or if you have some kind of logging class and you need to keep the table efficient and small. The only problem is that the schema generator always inserts a foreign column constraint (probably the last specified) when generating these kind of Entities.

This PR ensures that the foreign key is not added if there are at least two different classes mapped on the same field of a db table.



 Comments   
Comment by Doctrine Bot [ 20/Dec/13 ]

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





[DDC-2017] [GH-438] Fixed Parser problem for SELECT (((3))) as .... Created: 07/Sep/12  Updated: 20/Dec/13  Resolved: 05/Nov/12

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

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


 Description   

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

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

Message:

where the ((( would be incorrectly treated as function



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

Merged : https://github.com/doctrine/doctrine2/commit/ec1950d3cac918935e0f05c1fb79bbd592caed87

Comment by Doctrine Bot [ 20/Dec/13 ]

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





[DDC-2037] [GH-450] fix some phpdoc Created: 20/Sep/12  Updated: 19/Dec/13  Resolved: 05/Oct/12

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

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


 Description   

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

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

Message:



 Comments   
Comment by Benjamin Eberlei [ 21/Sep/12 ]

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

Comment by Doctrine Bot [ 19/Dec/13 ]

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





[DDC-2582] [GH-741] Fixed DDC-1884. Created: 30/Jul/13  Updated: 18/Dec/13  Resolved: 08/Aug/13

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

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


 Description   

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

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

Message:

Fixed original failing test case provided in https://github.com/doctrine/doctrine2/pull/395 and highlighted as an issue in http://www.doctrine-project.org/jira/browse/DDC-1884



 Comments   
Comment by Doctrine Bot [ 30/Jul/13 ]

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

Comment by Doctrine Bot [ 30/Jul/13 ]

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

Comment by Fabio B. Silva [ 08/Aug/13 ]

Merged, For more details see : https://github.com/doctrine/doctrine2/pull/741

Comment by Doctrine Bot [ 18/Dec/13 ]

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





[DDC-1980] [GH-423] DDC-1955 - @EntityListeners Created: 12/Aug/12  Updated: 18/Dec/13  Resolved: 27/Feb/13

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

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


 Description   

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

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

Message:

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

Hi.

This path adds support for ```@EntityListeners```

This path add another way to handle events
allow configure the same listener for many specific entities.
And give the EventArg in the current lifecycle callback system.

Usage :

```php
<?php
/**

  • @EntityListeners( {"ContractListener"}

    )

  • @HasLifecycleCallbacks
  • @Entity
    */
    class Contract
    {
    /** @PostLoad */
    public function postLoadHandler(LifecycleEventArgs $event) { // do something }
    }
    class ContractListener
    {
    /** @PrePersist */
    public function prePersistHandler(Contract $contract)
    { // do something }

    /**

  • @PostPersist
  • Most of cases just the entity is needed.
  • as a second parameter LifecycleEventArgs allow access to the entity manager.
    */
    public function postPersistHandler(Contract $contract, LifecycleEventArgs $args) { // do something }

    }
    ```



 Comments   
Comment by Fabio B. Silva [ 27/Feb/13 ]

Merged : https://github.com/doctrine/doctrine2/commit/71a68a5c6fcd49538c3ef2f86d64bcde1958251c

Comment by Doctrine Bot [ 18/Dec/13 ]

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





[DDC-1978] SQLParserUtils array_fill tries to create array with zero elements when empty parameter is bound Created: 10/Aug/12  Updated: 18/Dec/13  Resolved: 29/Aug/12

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

Type: Bug Priority: Minor
Reporter: Matt Button Assignee: Fabio B. Silva
Resolution: Fixed Votes: 0
Labels: None
Environment:

PHP 5.3.6-13ubuntu3.8 with Suhosin-Patch (cli) (built: Jun 13 2012 17:19:54)

{ "package": "doctrine/common", "version": "2.2.2" }

,

{ "package": "doctrine/dbal", "version": "2.2.x-dev", "source-reference": "b961a3fce6bf220f1dca47d7d747b9074bea4730", "commit-date": "1341779435" }

,

{ "package": "doctrine/doctrine-bundle", "version": "dev-master", "source-reference": "62134e6a8dd3f330131ee6a970f0cee1d7760c1d", "commit-date": "1343203511" }

,

{ "package": "doctrine/orm", "version": "2.2.x-dev", "source-reference": "5d2a3bcb3b467f41ee58575764f3ba84937f76e4", "commit-date": "1341676080" }

,



 Description   

When binding an empty array as a parameter (and specifying a parameter type to work around DDC-1977) SQLParserUtils::expandListParameters tries to use array_fill to generate an empty array.

https://github.com/doctrine/dbal/blob/master/lib/Doctrine/DBAL/SQLParserUtils.php#L127

Pseudo-code that generated the bug:

$this->getEntityManager()->createNativeQuery($query, $rsm)->setParameter(1, array())->getArrayResult();


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

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

Comment by Benjamin Eberlei [ 15/Aug/12 ]

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

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

Fixed by : https://github.com/doctrine/dbal/commit/24ec1947a83b82101845889ba4fc7f3cbd0e5a90

Comment by Doctrine Bot [ 18/Dec/13 ]

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





[DDC-1979] [GH-422] DDC-1574 - "new" operator Created: 12/Aug/12  Updated: 12/Dec/13  Resolved: 27/Feb/13

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

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


 Description   

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

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

Message:

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

Hi guys.

This path adds support for "new" operator

Usage :
```SQL
SELECT
new CustomerDTO(c.name, e.email, a.city)
FROM
Customer c
JOIN
u.email e
JOIN
u.address a
ORDER BY
u.name
```

Any simple class with a constructor could be used
but for the first version just scalar values are allowed.

it's a big patch, so any sugestion are welcome.

Thanks.



 Comments   
Comment by Fabio B. Silva [ 27/Feb/13 ]

Merged : https://github.com/doctrine/doctrine2/commit/13762f20c9f6daa0c2e4e8a113de01969c6621da

Comment by Doctrine Bot [ 12/Dec/13 ]

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





[DDC-2000] [GH-431] [ORM] Fix double semicolon Created: 29/Aug/12  Updated: 26/Nov/13  Resolved: 29/Aug/12

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

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


 Description   

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

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

Message:



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

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

Comment by Doctrine Bot [ 26/Nov/13 ]

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





[DDC-2807] Add support for char fields in the ORM layer Created: 24/Jan/10  Updated: 21/Nov/13  Resolved: 21/Nov/13

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

Type: Improvement Priority: Minor
Reporter: Glen Ainscow Assignee: Roman S. Borschel
Resolution: Fixed Votes: 0
Labels: None


 Description   

It's not possible to use char fields in the ORM layer.

It should be possible to use something like:

@Column(type="char") or ...
@Column(type="string", fixed=true) or ...
@Column(type="fixedstring")



 Comments   
Comment by Roman S. Borschel [ 24/Jan/10 ]

I dont think this is worth including in the main distribution. A char does not save much compared to a varchar (1 Byte?) and you already have 2 options to make a char:

  • create your own custom type (i.e. FixedString)
  • Use @Column(..., columnDefinition="CHAR(2)")

IMHO, just use a string type with the length you want: @Column(type="string", length=2). That becomes a varchar with length 2.

Comment by Glen Ainscow [ 24/Jan/10 ]

Ya, it is only 1 extra byte. I'm not sure what to do, I like things as optimized as possible, but I guess I could just use columnDefinition if necessary.

Comment by Glen Ainscow [ 24/Jan/10 ]

Actually, I don't really see any reason not to include the char type.

Comment by Roman S. Borschel [ 24/Jan/10 ]

How about code bloat?

Comment by Glen Ainscow [ 24/Jan/10 ]

How many LoC?

Comment by Guilherme Blanco [ 25/Jan/10 ]

@darkangel Around 40. And lots of conditionals, which decreases efficiency of algorithm.

I vote for FixedString DBAL DataType.

Comment by Roman S. Borschel [ 25/Jan/10 ]

We will not put every special data type someone comes up with in the core library. If we go this route, at the end we have 100+ data types (100+ classes plus a bloated type map) in the core library.

There are at least 2 decent options of making a char already if you care about byte counting (see above).

"Why not?" is not the question to ask for when it comes to new features. If it were, we would include a whole lot of stuff that is useless for 99% of the users. There must be strong arguments for "Why?" and there are none.

If we get 50+ votes on this issue we can talk again.

Comment by Glen Ainscow [ 25/Jan/10 ]

Of course not. I didn't know that char was a special data type (especially since it's supported in DC1.2).

I will use @columnDefinition.

You may close this issue.

Comment by Roman S. Borschel [ 25/Jan/10 ]

No need to become defensive. There is still the chance that demand for this particular type gets very high and that can change things.

Thats why this stays open. Otherwise the next guy would probably just create a duplicate ticket (not sure whether non-owners can reopen other tickets).

Comment by Benjamin Eberlei [ 25/Jan/10 ]

@Glen

The problem with Doctrine 1 and having lots of different data-types is that of maintainability. You have to ensure that all the types work on all supported platforms with each and every version. The more datatypes we support by default the more complex will it be for the Doctrine 2 Core to ensure compability and maintainability in this regard.

For each new platform that we will support all datatypes have to be supported for example, something that might even become impossible for some databases.

Adding a datatype from the user perspective is rather simple though, it has to be tested once and is only about 20-40 LOC. I bet you 100 bucks that soon there will be code-snippets out there on all the different database specific types as a doctrine 2 implemention.

Comment by Glen Ainscow [ 25/Jan/10 ]

@Roman
Not being defensive, I have accepted/respected your decision.

@Benamin
I did think about cross-database compatibility. As far as I know, char is supported by the vast majority (or at least easily simulated). But I understand.

Thanks.

Comment by Dmitry Strygin [ 17/Sep/11 ]

Sorry for party rocking but i think that 'fixed' annotation should be enabled in ORM column definitions.
In this case @Column(type="string", length=4, fixed=true) would result in "CHAR(4)" for MySQL, Oracle and Postgres, Sqlite, and DB2, "NCHAR(4)" for MQSQL. etc... It is much more elegant than that columnDefinition.
It is already supported by DBAL as well as 'default' heartlessly removed (DDC-100) from annotation driver due to bizzare reluctance to deal with proper escaping of values.

Comment by Steve Müller [ 24/Jun/13 ]

As Dmitry stated, this is fixed by the "fixed" property. Shouldn't this be closed?

Comment by Steve Müller [ 21/Nov/13 ]

Fixed in 2.4.0:

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

You can pass column options:

@Column(type="string", options={"fixed" = true})

This generates a CHAR instead of VARCHAR column.





[DDC-1956] [GH-413] code refactorings on persister Created: 29/Jul/12  Updated: 18/Nov/13  Resolved: 14/Mar/13

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

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


 Description   

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

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

Message:

hi

This patch does not add any feature, just small refactorings and code clean up.
It make easier to implement the generation of persisters:
http://www.doctrine-project.org/jira/browse/DDC-1889

Cheers ...



 Comments   
Comment by Fabio B. Silva [ 14/Mar/13 ]

Merged : https://github.com/doctrine/doctrine2/commit/05e5ae8bfa1a452d273a3a6b27b6311c287a9976

Comment by Doctrine Bot [ 18/Nov/13 ]

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





[DDC-2060] [GH-465] Fixed a typo in ConcatFunction Created: 08/Oct/12  Updated: 08/Sep/13  Resolved: 25/Oct/12

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

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


 Description   

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

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

Message:



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

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

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

Merged : https://github.com/doctrine/doctrine2/commit/65fabc20c9e807c7b5f86741d60d4a0cecab7ebc





[DDC-2125] [GH-504] Proposed fix for DDC-1241 Created: 05/Nov/12  Updated: 08/Sep/13  Resolved: 06/Nov/12

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

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


 Description   

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

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

Message:



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

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

Comment by Fabio B. Silva [ 06/Nov/12 ]

Merged : https://github.com/doctrine/doctrine2/commit/283ed55824b7c713611e4b1e336551be805c48b5





[DDC-2084] EM#find() with association as PK Created: 16/Oct/12  Updated: 08/Sep/13  Resolved: 06/Nov/12

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

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


 Description   

Say I have a association as primary key in my entity, and I want to find it by id.
I'm calling EntityManager#find("MyEntity1", MyEntity2 $entity),
then it calls UnitOfWork#tryGetById() wich makes implode of sorted ids, and that is error, because sortedId contains object.

I can implement __toString in my entity, but I think this is work of ORM.
What are your thoughts?
I could fix that, but is there some instruction on Doctrine's workflow?



 Comments   
Comment by Fabio B. Silva [ 06/Nov/12 ]

Fixed : https://github.com/doctrine/doctrine2/commit/d6d5c341e220ff7aec50c8ecabd5d0b8be2e0804

Comment by Nikita Nefedov [ 06/Nov/12 ]

What about composite keys? AFAIS, this code checks if id is object, but it could be an array of objects.





[DDC-2180] [GH-527] Fix documentation for Doctrine\ORM\Query\AST\Node::dispatch() Created: 30/Nov/12  Updated: 08/Sep/13  Resolved: 30/Nov/12

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

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


 Description   

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

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

Message:

Because Node::dispatch() is not documented as `@return string`, static code analysis returned the following error in our project:

> void method 'dispatch' result used

This fixes the documentation for this method.



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

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





[DDC-2212] [GH-542] [DDC-2205] Fix DDC-2205 Created: 21/Dec/12  Updated: 08/Sep/13  Resolved: 21/Dec/12

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

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


 Description   

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

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

Message:

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



 Comments   
Comment by Benjamin Eberlei [ 21/Dec/12 ]

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

Comment by Fabio B. Silva [ 21/Dec/12 ]

merged : https://github.com/doctrine/doctrine2/commit/8b5e4a9a52670992b85e7223d255b98cf77a35a3





[DDC-2191] Bug in QueryBuilder::add() method, param $append has no effect for where/having DQL parts Created: 07/Dec/12  Updated: 08/Sep/13  Resolved: 06/Jan/13

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: Git Master
Fix Version/s: 2.4

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


 Description   

Now $append param of QueryBuilder::add() method has no effect for where and having parts.

In example:

$query->add('where', 'u.some = ?1');
$query->add('where', 'u.other = ?2', true);

will result in the loss of condition u.some = ?1

Explanation in code
526 line of Doctrine/ORM/QueryBuilder.php, part of body add() method:

if ($append && $isMultiple) {
    if (is_array($dqlPart)) {
        $key = key($dqlPart);
        $this->_dqlParts[$dqlPartName][$key][] = $dqlPart[$key];
    } else {
        $this->_dqlParts[$dqlPartName][] = $dqlPart;
    }
} else {
    $this->_dqlParts[$dqlPartName] = ($isMultiple) ? array($dqlPart) : $dqlPart;
}

According to the code above $append parameter is checked in conjunction with $isMultiple variable, which is:

$isMultiple = is_array($this->_dqlParts[$dqlPartName]);

But in 56 line of this file, class property _dqlParts keys where and having are equal null:

private $_dqlParts = array(
    'distinct' => false,
    'select'  => array(),
    'from'    => array(),
    'join'    => array(),
    'set'     => array(),
    'where'   => null,
    'groupBy' => array(),
    'having'  => null,
    'orderBy' => array()
);

As a result, for the parts where and having condition $append && $isMultiple will never be true, regardless of $append value.

I can offer a patch on Github to fix this bug, if necessary.



 Comments   
Comment by Benjamin Eberlei [ 06/Jan/13 ]

This was and will never be allowed, i introduced an exception to show a way out, you need to look at QueryBuilder#andWhere for example to see a solution to append to where clauses.





[DDC-2233] [GH-548] Fix for DDC-2203 Created: 10/Jan/13  Updated: 08/Sep/13  Resolved: 10/Jan/13

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

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


 Description   

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

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

Message:

Introduces the isEnabled method as proposed in DDC-2203



 Comments   
Comment by Benjamin Eberlei [ 10/Jan/13 ]

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





[DDC-2241] [GH-549] [DDC-1376] Support for order by association when using findBy Created: 14/Jan/13  Updated: 08/Sep/13  Resolved: 14/Jan/13

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

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


 Description   

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

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

Message:

This patch add support for ORDER BY association when using findBy
http://www.doctrine-project.org/jira/browse/DDC-1376



 Comments   
Comment by Benjamin Eberlei [ 14/Jan/13 ]

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





[DDC-2261] [GH-558] Added missing mapping types Created: 26/Jan/13  Updated: 08/Sep/13  Resolved: 26/Jan/13

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

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


 Description   

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

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

Message:



 Comments   
Comment by Benjamin Eberlei [ 26/Jan/13 ]

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





[DDC-2271] [GH-564] Fix a wrong return type Created: 03/Feb/13  Updated: 08/Sep/13  Resolved: 05/Feb/13

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

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


 Description   

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

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

Message:

`BasicEntityPersister::executeInserts()` is documented as:

@return array An array of any generated post-insert IDs. This will be an empty array
if the entity class does not use the IDENTITY generation strategy.

This PR fixes an empty `return;` that contradicted the documented return type.



 Comments   
Comment by Benjamin Eberlei [ 03/Feb/13 ]

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

Comment by Fabio B. Silva [ 05/Feb/13 ]

Merged : https://github.com/doctrine/doctrine2/commit/f0674ea034a12e99cfe745122ef3b3b71204657f





[DDC-2284] [GH-573] [Documentation] Noted prePersist event only triggers on first persist Created: 07/Feb/13  Updated: 08/Sep/13  Resolved: 08/Feb/13

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

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


 Description   

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

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

Message:

While probably obvious to a core doctrine developer, a user of doctrine would not necessarily know this without doing some digging or [stack overflowing](http://stackoverflow.com/questions/7934555/doctrine-2-prepersist-doesnt-fire)



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

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





[DDC-2293] [GH-578] Fix for wrong return types in documentation. Created: 12/Feb/13  Updated: 08/Sep/13  Resolved: 12/Feb/13

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

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


 Description   

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

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

Message:

Several methods were declaring erroneous / incomplete return types.
This PR fixes them.



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

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





[DDC-2277] [GH-570] Deprecation of PEAR/GIT/TAR autoloading Created: 04/Feb/13  Updated: 08/Sep/13  Resolved: 14/Feb/13

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

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


 Description   

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

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

Message:

Updates the test suite to use composer based autoloading



 Comments   
Comment by Benjamin Eberlei [ 14/Feb/13 ]

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

Comment by Marco Pivetta [ 14/Feb/13 ]

Merged





[DDC-2298] [GH-581] Removing submodules Created: 15/Feb/13  Updated: 08/Sep/13  Resolved: 15/Feb/13

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

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


 Description   

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

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

Message:

Removing submodules (my bad, wasn't done in #570 )



 Comments   
Comment by Benjamin Eberlei [ 15/Feb/13 ]

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

Comment by Marco Pivetta [ 15/Feb/13 ]

merged





[DDC-1734] Uninitialized proxies cannot be serialized properly Created: 29/Mar/12  Updated: 08/Sep/13  Resolved: 21/Feb/13

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

Type: Bug Priority: Major
Reporter: Benjamin Morel Assignee: Marco Pivetta
Resolution: Fixed Votes: 1
Labels: None


 Description   

I have the following entity:

class Currency
{
    /** @Id @Column(type="string") */
    protected $code;
        
    /** @Column(type="string") */    
    protected $name;
}

When I serialize an object graph which references a Currency proxy, but this proxy is initialized, then this works as expected:

O:65:"Application\Domain\Proxy\__CG__\Application\Domain\Model\Currency":3:{s:17:"__isInitialized__";b:1;s:7:"*code";s:3:"USD";s:7:"*name";s:20:"United States Dollar";}

However, if the proxy is not initialized, then all properties are serialized as null, and the identity is lost:

O:65:"Application\Domain\Proxy\__CG__\Application\Domain\Model\Currency":3:{s:17:"__isInitialized__";b:0;s:7:"*code";N;s:7:"*name";N;}

That makes a merge() impossible once stored in a session, as the identity of the entity is now unknown.

I think the solution might be:

  • either to have the proxy's $_identity field serialized as well
  • or to have the $code (identity field) populated when the proxy is created.


 Comments   
Comment by Marco Pivetta [ 03/Apr/12 ]

I am personally for dropping the `$_identifier` field and using the entity fields themselves. Will check this tomorrow. (also: not sure if it is possible, just checking)

Comment by Benjamin Eberlei [ 07/Apr/12 ]

This is not fixable. The Proxy requires access to the Entity Persister when unserialized, but that is not available anymore. Proxies are broken if unserialized and then accessed, i believe an exception is thrown in this case.

Comment by Benjamin Morel [ 07/Apr/12 ]

Of course they cannot be initialized once unserialized, but should'nt be merge()able to a new EntityManager anyway?

What I would imagine is:

Comment by Benjamin Morel [ 30/Oct/12 ]

@Marco Pivetta This is a great idea. Have you checked if it is possible?
I'm really surprised that a proxied entity's identity is lost forever upon serialization.

Comment by Matthieu Napoli [ 30/Nov/12 ]

Can this issue be reopened please?

As Benjamin Morel said, it is expected that the proxy is broken once unserialized, but it should be possible to merge to the EntityManager and then use it.

For now, objects graphs with proxies can't be serialized! It could be if the merge would resolve the situation.

I'm giving it a try by serializing the $_identifier field in the Proxy

Thanks

Comment by Marco Pivetta [ 30/Nov/12 ]

Benjamin Morel you can check my implementation for DCOM-96 at https://github.com/doctrine/common/pull/168 and https://github.com/doctrine/doctrine2/pull/406

Comment by Marco Pivetta [ 30/Nov/12 ]

Matthieu Napoli can you try adding $identifier at https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Proxy/ProxyFactory.php#L319-L323 ?

Comment by Matthieu Napoli [ 30/Nov/12 ]

Marco Pivetta Yes that's what I'm planning to do. I've written a testcase that reproduces the bug right now.

Comment by Marco Pivetta [ 30/Nov/12 ]

Matthieu Napoli awesome. If you can attach the test here, it would be possible to add it to the proxy refactoring.

Comment by Matthieu Napoli [ 30/Nov/12 ]

@ocramius I will make a pull request on Github and post the link here.

However I'm sort of stuck right now: I've added '_identifier' to the fields serialized, but it's not enough. To merge, the UoW needs to initialize the proxy to get the identifiers (because $_identifier is private in the proxy). Problem: $_entityPersister (used to initialize the proxy) is also private.

So I can neither get the identifier of the proxy (even for creating a new proxy for example), nor feed it a new entityPersister to load it... The solution would be to change the proxy a bit (like adding a "__setEntityPersister" method for example) but I guess that changing the Proxy interface in "Doctrine\Common" is a large change and that will not be accepted as a pull request...

Any ideas ?

Comment by Marco Pivetta [ 30/Nov/12 ]

Matthieu Napoli I wouldn't start hacking on that right now... The new impl allows injecting an initializer. A hack may be ok-ish, but the API is already at its EOL.

Comment by Marco Pivetta [ 30/Nov/12 ]

Matthieu Napoli I'd think of marking this as to be fixed in 2.4.x

Comment by Matthieu Napoli [ 30/Nov/12 ]

Marco Pivetta I'm working on the master branch, it's 2.4 right? I don't see anything different for the proxies in this branch (I don't see any way to inject an initializer).

Or is it your PR (https://github.com/doctrine/common/pull/168) maybe?

Comment by Benjamin Morel [ 30/Nov/12 ]

I'm happy that this bug is taken care of, I think that's a major problem that's been dismissed a bit quickly.
Can the bug be reopened, with fix version 2.4, to avoid forgetting it once more?

Comment by Matthieu Napoli [ 30/Nov/12 ]

Benjamin Morel +1

Comment by Marco Pivetta [ 30/Nov/12 ]

Matthieu Napoli yes, that's the PR. Please let me know for the tests so that I can add them to doctrine/common.
I'm re-opening the issue

Comment by Marco Pivetta [ 30/Nov/12 ]

Re-opening issue - need test to verify the behavior before proceeding.

Comment by Matthieu Napoli [ 03/Dec/12 ]

Marco Pivetta Sorry the test was on my computer at work, here it is now: https://gist.github.com/4193721

Just to be clear: I created 2 test methods, the first one works (there is no serialization step), the second doesn't. This is to make it clear that the serialization step is the problem. I hope this is alright.

Comment by Marco Pivetta [ 03/Dec/12 ]

Matthieu Napoli thank you for the test. But please fix the tests so that both fail (if these are actually two verified cases).

Comment by Matthieu Napoli [ 03/Dec/12 ]

Marco Pivetta No those aren't 2 different cases, they are the same, it's just that one fails because we use serialization (this is the problem described in this ticket), and the other one works because we don't use serialization (and it only exists to check that everything works if we don't use serialization). Actually I think the "working test" has no reason to exist really, I just made it to "prove" that the problem was indeed the serialization, so it can be removed.

Comment by Marco Pivetta [ 03/Dec/12 ]

Matthieu Napoli ok, so I can basically strip the working one

Comment by Marco Pivetta [ 06/Jan/13 ]

Matthieu Napoli I deployed a fix in DCOM-96 ( https://github.com/doctrine/doctrine2/pull/406 https://github.com/Ocramius/doctrine2/commit/1424cc781277a4f8183229c5e8d838724e1ca879 )

Comment by Matthieu Napoli [ 15/Jan/13 ]

Marco Pivetta fantastic!

Comment by Benjamin Eberlei [ 25/Jan/13 ]

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

Comment by Benjamin Eberlei [ 26/Jan/13 ]

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

Comment by Marco Pivetta [ 21/Feb/13 ]

Resolved in DCOM-96





[DDC-2315] [GH-587] Fixed the license and the added version for NewObjectExpression Created: 22/Feb/13  Updated: 08/Sep/13  Resolved: 22/Feb/13

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

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


 Description   

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

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

Message:

this feature is new in 2.4, not 2.3



 Comments   
Comment by Benjamin Eberlei [ 22/Feb/13 ]

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





[DDC-2230] Changes from DDC-1690 trigger a bug in entity merging Created: 09/Jan/13  Updated: 08/Sep/13  Resolved: 26/Feb/13

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

Type: Bug Priority: Critical
Reporter: Patrick Schwisow Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: None


 Description   

Following the changes for DDC-1690, I encountered a serious bug in how EntityManager::merge(...) functions for entities that use NOTIFY change tracking. It's related to interaction between lazy loading and calls to addPropertyChangedListener().

Scenario:

  • EntityA has a One-To-One, lazy-load association to EntityB
  • EntityB implements NotifyPropertyChanged and uses change tracking policy "NOTIFY"

Steps to reproduce:

  1. $instanceA = $em->find('EntityA', $id)
  2. $em->clear()
  3. $instanceA = $em->merge($instanceA)
  4. $instanceA->getB() will return a proxy for B that is marked as initialized by contains no data

Workaround: Mark EntityB::addPropertyChangedListener(...) as 'final', so it doesn't get proxied and lazy loading is not triggered.



 Comments   
Comment by Patrick Schwisow [ 09/Jan/13 ]

Also, the returned proxy from $instanceA->getB() is in the entityStates array but not in the identity map

Comment by Marco Pivetta [ 23/Jan/13 ]

Looks like this one is related to DDC-1734

Comment by Marco Pivetta [ 23/Feb/13 ]

I implemented a fix at https://github.com/Ocramius/doctrine2/compare/hotfix;DDC-2230

Please let me know if that branch works for you: I will open a PR tomorrow.

Comment by Benjamin Eberlei [ 23/Feb/13 ]

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

Comment by Benjamin Eberlei [ 26/Feb/13 ]

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





[DDC-2325] [GH-594] Use inflector in EntityGenerator Created: 28/Feb/13  Updated: 08/Sep/13  Resolved: 01/Mar/13

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

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


 Description   

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

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

Message:

The way EntityGenerator handles add/edit methods is wrong.

Example:

class SomeEntity

{ /* @ORM\OneToMany(...) */ private $entries; }

In this case the generator creates

addEntrie and removeEntrie methods. They should be be addEntry and removeEntry

This patch fixes that.



 Comments   
Comment by Benjamin Eberlei [ 01/Mar/13 ]

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

Comment by Marco Pivetta [ 01/Mar/13 ]

merged





[DDC-2328] [GH-597] use the extended proxy interface in the same namespace Created: 01/Mar/13  Updated: 08/Sep/13  Resolved: 03/Mar/13

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

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


 Description   

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

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

Message:

Fix for this error:

FatalErrorException: Compile Error: Cannot use Doctrine\Common\Proxy\Proxy as Proxy because the name is already in use in .../vendor/doctrine/orm/lib/Doctrine/ORM/Proxy/ProxyFactory.php line 26



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

Marking as blocker - has to go in before 2.4

Comment by Benjamin Eberlei [ 03/Mar/13 ]

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

Comment by Marco Pivetta [ 03/Mar/13 ]

merged





[DDC-2343] [GH-608] Fixed typo Created: 11/Mar/13  Updated: 08/Sep/13  Resolved: 11/Mar/13

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

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


 Description   

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

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

Message:



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

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





[DDC-2342] [GH-607] Fixed typos Created: 11/Mar/13  Updated: 08/Sep/13  Resolved: 11/Mar/13

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

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


 Description   

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

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

Message:



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

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





[DDC-2344] [GH-609] Fixed typo. Created: 11/Mar/13  Updated: 08/Sep/13  Resolved: 11/Mar/13

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

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


 Description   

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

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

Message:



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

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





[DDC-2367] [GH-628] [Docs] Fix field name in inversedby parameter Created: 24/Mar/13  Updated: 08/Sep/13  Resolved: 08/Sep/13

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

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


 Description   

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

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

Message:



 Comments   
Comment by Benjamin Eberlei [ 24/Mar/13 ]

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





[DDC-2368] [GH-629] Fixed typos in Doctrine Mapping Types section. Created: 24/Mar/13  Updated: 08/Sep/13  Resolved: 08/Sep/13

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

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


 Description   

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

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

Message:

Hello guys! I am fixing some of the documentation in ``basic-mapping.rst`` that display an incorrect use of 'an' where 'a' should reside. Specifically in regards to instances of 'an SQL'.



 Comments   
Comment by Benjamin Eberlei [ 24/Mar/13 ]

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





[DDC-2371] [GH-631] Fix typo in one of the orderBy examples. Created: 26/Mar/13  Updated: 08/Sep/13  Resolved: 08/Sep/13

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

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


 Description   

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

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

Message:

Fix typo in one of the orderBy examples.



 Comments   
Comment by Benjamin Eberlei [ 26/Mar/13 ]

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





[DDC-1010] Crash when fetching results from qb inside postLoad event Created: 01/Feb/11  Updated: 08/Sep/13  Resolved: 08/Sep/13

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

Type: Documentation Priority: Minor
Reporter: Matevz Jekovec Assignee: Guilherme Blanco
Resolution: Fixed Votes: 1
Labels: None
Environment:

PHP 5.3.3-1ubuntu9.3
KUbuntu 10.10



 Description   

I registered an event listener to my entity manager and on a postLoad event, I want to prepare some data in a nice way (fetch translations for my library + store into associative array into entity). Here's my snippet:

class TranslationListener implements EventSubscriber
{
    public function getSubscribedEvents()
    {
        return array(Events::postLoad);
    }

    public function postLoad(LifecycleEventArgs $args)
    {
        $em = $args->getEntityManager();
        $entity = $args->getEntity();

        if ($entity instanceof Lib) {
            $qb = $em->createQueryBuilder();
            $qb = $qb->select('T')->from('Translate', 'T')->join('T.locale', 'TT')->where('T.lib = ?1')->setParameter(1, $entity->idLib);
            $res = $qb->getQuery()->getResult();
            foreach ($res as $tr) {
                $entity->tr[$tr->locale->idLocale] = $tr;
            }
        }
    }
}

When this code is run (eg. getting the Library objects), I got a crash where getResult() is called:

Fatal error: Call to a member function fetch() on a non-object in /home/thepianoguy/testproject/trunk/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php on line 126
Call Stack
#	Time	Memory	Function	Location
1	0.0004	656080	{main}( )	../index.php:0
2	0.1081	18760176	TApplication->run( )	../index.php:48
3	0.2637	33817288	TApplication->runService( )	../TApplication.php:382
4	0.2637	33817288	TPageService->run( )	../TApplication.php:1095
5	0.2698	34788448	TPageService->runPage( )	../TPageService.php:444
6	0.2715	34986768	TPage->run( )	../TPageService.php:498
7	0.2716	34989128	TPage->processNormalRequest( )	../TPage.php:198
8	0.3383	42770128	TControl->loadRecursive( )	../TPage.php:215
9	0.3383	42770208	ContactUserAddEdit->onLoad( )	../TControl.php:1286
10	0.3383	42771912	ContactUserAddEdit->loadData( )	../ContactUserAddEdit.php:56
11	0.3452	43436904	Doctrine\ORM\AbstractQuery->getResult( )	../ContactUserAddEdit.php:124
12	0.3452	43437296	Doctrine\ORM\AbstractQuery->execute( )	../AbstractQuery.php:366
13	0.4160	47009328	Doctrine\ORM\Internal\Hydration\AbstractHydrator->hydrateAll( )	../AbstractQuery.php:537
14	0.4160	47011504	Doctrine\ORM\Internal\Hydration\ObjectHydrator->_hydrateAll( )	../AbstractHydrator.php:99

If I comment the line 137 in Doctrine/ORM/Internal/Hydration/AbstractHydrator in _cleanup(), my code works fine:
// $this->_stmt = null;

I think there is a problem when using alredy used entity manager and query builder inside the postLoad event.



 Comments   
Comment by Benjamin Eberlei [ 02/Feb/11 ]

The hydrator is reused internally, this is potentially dangerous as I figure from your use-case.

Comment by Benjamin Eberlei [ 02/Feb/11 ]

A workaround is to re-registr the object hydrator under a new name

$configuration->setHydrationMode("object2", "Doctrine\ORM\Internal\Hydration\ObjectHydrator");

and use it in your query.

$query->setHydrationMode("object2");
Comment by Marco Pivetta [ 23/Jan/13 ]

Marking as documentation issue, since the user has to be warned that `postLoad` has to use a dedicated hydrator to execute more load operations.

Comment by Guilherme Blanco [ 30/Jul/13 ]

I fixed this issue in master as of https://github.com/doctrine/doctrine2/commit/8d13601e39d0fdefdd1d2c0a85704c440b8bdd37

Cheers,

GB





[DDC-1863] [GH-366] [PoC] Arbitrary join support Created: 09/Jun/12  Updated: 08/Sep/13  Resolved: 08/Sep/13

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

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


 Description   

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

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

Message:



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

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

Comment by Guilherme Blanco [ 22/Jun/12 ]

PR was closed.

Comment by Doctrine Bot [ 05/Sep/13 ]

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

Comment by Benjamin Eberlei [ 08/Sep/13 ]

Replaced by another PR

Comment by Benjamin Eberlei [ 08/Sep/13 ]

This is actually the only issue for that





[DDC-2377] [GH-636] Fixed typos in documentation. Created: 28/Mar/13  Updated: 08/Sep/13  Resolved: 08/Sep/13

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

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


 Description   

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

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

Message:

Hello again everyone! I went ahead and fixed the rest of the instances in the documentation that used 'an SQL'. I also fixed an instance of 'a alias' to be 'an alias', which is proper since alias begins with a vowel.



 Comments   
Comment by Benjamin Eberlei [ 28/Mar/13 ]

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





[DDC-2379] [GH-637] Update association-mapping.rst Created: 29/Mar/13  Updated: 08/Sep/13  Resolved: 08/Sep/13

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

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


 Description   

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

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

Message:



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

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





[DDC-2386] [GH-641] Added yml example in ordered-associations.rst Created: 03/Apr/13  Updated: 08/Sep/13  Resolved: 08/Sep/13

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

Type: Documentation Priority: Major
Reporter: Benjamin Eberlei Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:

Added missing yaml example of ordered-associations, and put php, xml and yml codes into a configuration-block instead of separate code-blocks



 Comments   
Comment by Benjamin Eberlei [ 03/Apr/13 ]

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

Comment by Marco Pivetta [ 03/Apr/13 ]

merged





[DDC-2388] Zend Optimizer Plus/opcache have overlap in config settings, annotations reader doesn't identify these properly Created: 04/Apr/13  Updated: 08/Sep/13  Resolved: 20/Apr/13

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: Mapping Drivers
Affects Version/s: 2.3.3
Fix Version/s: 2.4

Type: Bug Priority: Minor
Reporter: Ross Cousens Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

Doctrine\Common\Annotations\AnnotationReader.php

A change was recently authored in the AnnotationReader constructor that checked for a properly configured opcode cache (namely saving comments so that Doctrine can parse annotations).

The current open source version of Zend Optimizer+ hosted at GitHub (https://github.com/zend-dev/ZendOptimizerPlus) when loaded registers itself as a module with the name "Zend Optimizer+" but takes configuration directives in the form of "opcache.<parameter>".

The change to the constructor requires that if the module name is Zend Optimizer+, then the configuration directives must be prefixed with "zend_optimizerplus.<parameter>". This is clearly incorrect.

The most recent update now complains of an AnnotationException as a consequence of this change when running Symfony2 (or Doctrine) with the latest opcache because configuration directives aren't detected properly.

I am happy to fix this but could not find a way to report an issue to initiate the process.

I would suggest something like this in the constructor:

if ((extension_loaded('Zend Optimizer+') || extension_loaded('opcache')) && !(ini_get('opcache.save_comments') == 0 XOR ini_get('zend_optimizerplus.save_comments') == 0)) {

What this means is that if either extension is loaded, one of those directives must be true and configured. This is a compromise. The alternative would be to keep the original source and do the following:

if (extension_loaded('Zend Optimizer+') && ini_get('zend_optimizerplus.save_comments') == 0) {
if (ini_get('opcache.save_comments') == 0)

{ throw AnnotationException::optimizerPlusSaveComments(); }

}

if (extension_loaded('opcache') && ini_get('opcache.save_comments') == 0)

{ throw AnnotationException::optimizerPlusSaveComments(); }

I have no idea about the "opcache" module and what it actually equates to or whether it has alternative formats for its configuration directives. I feel like the second suggestion is even smellier than my original suggestion despite probably handling the edge case better.

If you want a pull request, I will send one, just let me know how you want to handle it.

If my PHP is horrible I apologise.



 Comments   
Comment by Marco Pivetta [ 04/Apr/13 ]

Ross Cousens is this already enstabilished? It's not worth changing it until the ZO+ stuff is stable.

Comment by Ross Cousens [ 15/Apr/13 ]

Marco Pivetta Benjamin Eberlei

Seems stable to me.

I guess whether this is a priority or not depends on your subjective weighting of its importance and whether or not you use ZO+. I've ditched APC, and moved 20+ web servers over to Apache+ZO+. I currently deploy my own version of DBAL commons because it is not possible to work around it.

https://github.com/zend-dev/ZendOptimizerPlus

Please see this reference, why would they suddenly change the name of all the configuration directives especially in light of the fact that this is being integrated into PHP 5.5 as the standard generic "opcache" solution? I think this is where the confusion comes from. It might be branded as ZO+ on Github, but that becomes irrelevant when it's part of core.

I've tried contacting Beberlei directly (the author of the change), on Twitter and via e-mail, but no response. Not getting any response is quite annoying as it's been a month since this change was made and whenever I update an existing site or publish a new site I have to deal with this.

I need to invest some time in finding out how I can maintain my own fork of OSS projects that pull changes in from the branched master but allow me to keep 1 or 2 files totally different. The other thing that drives me insane is the fact that the postgresql platform drivers can't implement GUID generators because it requires an extension be enabled on the server (seriously, solve with documentation, it's easy to detect programmatically as well) plus the choosing of a function, when there is obviously only one sane choice.

I am so grateful for the opportunity to develop with OSS, but the bureaucratic decision-by-committee stuff is so frustrating when you're an end-user and can't find anyone who gives half a crap about stuff that is just plain stupid but overlooked due to resources already spread thin or whatever may be the case. I would be happy to develop fixes as well, but when they languish because you can't find a maintainer that is familiar with the issue, interested in finding a fix, and has the time available to act as custodian of a pull request, it is incredibly demoralizing.

Comment by Benjamin Eberlei [ 20/Apr/13 ]

Fixed and released a Collections 1.1.1 version

Comment by Ross Cousens [ 23/Apr/13 ]

Thanks Benjamin, I am grateful for the fix! Happy coding!





[DDC-2408] [GH-649] Update coding standards Created: 21/Apr/13  Updated: 08/Sep/13  Resolved: 21/Apr/13

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

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


 Description   

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

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

Message:

Removing underscores from property/method names and change use statements to PSR-2



 Comments   
Comment by Doctrine Bot [ 21/Apr/13 ]

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

Comment by Marco Pivetta [ 21/Apr/13 ]

merged





[DDC-2412] [GH-651] Fixed typo in SQLFilter (use statement ClassMetadata) Created: 23/Apr/13  Updated: 08/Sep/13  Resolved: 23/Apr/13

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:



 Comments   
Comment by Doctrine Bot [ 23/Apr/13 ]

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

Comment by Marco Pivetta [ 23/Apr/13 ]

merged





[DDC-2416] [GH-652] Fixed entities path Created: 26/Apr/13  Updated: 08/Sep/13  Resolved: 26/Apr/13

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

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


 Description   

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

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

Message:

In the tutorial, the user is told to create a new file in the `/src` folder, and the `/entities` folder is never referenced. Updating the SQLite schema according to the tutorial fails with the 'No Metadata Classes to process.' message. Changing the folder to `/src` fixes this, ostensibly.



 Comments   
Comment by Doctrine Bot [ 26/Apr/13 ]

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

Comment by Marco Pivetta [ 26/Apr/13 ]

merged





[DDC-2468] xml schema incomplete Created: 23/May/13  Updated: 08/Sep/13  Resolved: 26/May/13

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

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


 Description   

while writing the schema for phpcr-odm i noticed that the orm schema seems to miss some things. not sure if they are just missing in the schema but supported by the xml driver or if the xml driver also misses those:

cascade-type is missing

<xs:element name="cascade-detach" type="phpcr:emptyType" minOccurs="0"/>

lifecycle-callback-type is missing a bunch of callbacks:

<xs:enumeration value="onFlush"/>
<xs:enumeration value="postFlush"/>
<xs:enumeration value="onClear"/>
<xs:enumeration value="loadClassMetadata"/>



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

These are not lifecycle events? I am not sure they are necessary here.

Comment by Benjamin Eberlei [ 26/May/13 ]

Fixed cascade-detach missing





[DDC-2473] [GH-678] Fix an instance of doubled words in the docs Created: 27/May/13  Updated: 08/Sep/13  Resolved: 27/May/13

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

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


 Description   

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

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

Message:



 Comments   
Comment by Doctrine Bot [ 27/May/13 ]

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

Comment by Marco Pivetta [ 27/May/13 ]

merged





[DDC-2474] [GH-679] Fix getting started doc to work with current version Created: 28/May/13  Updated: 08/Sep/13  Resolved: 28/May/13

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

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


 Description   

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

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

Message:

The `cli-config.php` example provided at the getting started tutorial does not work with doctrine 2.4.



 Comments   
Comment by Doctrine Bot [ 28/May/13 ]

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

Comment by Marco Pivetta [ 28/May/13 ]

Merged at https://github.com/doctrine/doctrine2/commit/4e8b787d072fe48e798a1bd5cd05f08e9a083525





[DDC-2476] [GH-680] [wip] better reverse engineers the mapping metadata from a database Created: 29/May/13  Updated: 08/Sep/13  Resolved: 08/Sep/13

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

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


 Description   

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

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

Message:

  1. The problem:
    1.use symfony2 doctrine:mapping:import from msyql database to annotation
    2.use symfony2 doctrine:schema:update will see a lot of sql update about just import database schema.
    3.this PR fix eliminate some of those sql update...
  1. has fixed problem:
  • column default
  • column unsigned (add test)
  • column comment
  • column type decimal with precision and scale
  • table with simple index
  • table with unique index


 Comments   
Comment by Doctrine Bot [ 12/Jun/13 ]

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

Comment by Guilherme Blanco [ 12/Jun/13 ]

Fixed: https://github.com/doctrine/doctrine2/commit/3d86c82a7fb51875d1b6c66b865134c9ccf1a878

Comment by Guilherme Blanco [ 12/Jun/13 ]

https://github.com/doctrine/doctrine2/commit/3d86c82a7fb51875d1b6c66b865134c9ccf1a878

Comment by Benjamin Eberlei [ 08/Sep/13 ]

Fix Version 2.4





[DDC-2482] [GH-683] Explicitely state what the problem is Created: 03/Jun/13  Updated: 08/Sep/13  Resolved: 03/Jun/13

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

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


 Description   

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

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

Message:

People like me think the problem is that there is no association
mapping, when the problem in fact could be that there also is a field
mapping on the property.
This message makes it clearer why we are getting an error message.



 Comments   
Comment by Doctrine Bot [ 03/Jun/13 ]

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

Comment by Marco Pivetta [ 03/Jun/13 ]

Merged at https://github.com/doctrine/doctrine2/commit/3d6436c2f337d9e276c232e81a0e444edca98c8f





[DDC-2489] Missing semicolon in schema update tool, using dump-sql argument Created: 05/Jun/13  Updated: 08/Sep/13  Resolved: 08/Sep/13

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

Type: Bug Priority: Minor
Reporter: Robert-Jan Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: Cli, schematool


 Description   

When executing the schema-tool update script, using the --dump-sql argument (e.g. "app/console doctrine:schema:update --dump-sql" in a symfony2 project), the semicolon behind the last query is missing.



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

Fixed in https://github.com/doctrine/doctrine2/commit/0d834d0bd4015de2c103a03592c1543399f1b363





[DDC-2491] [GH-687] Fixed rendering Created: 06/Jun/13  Updated: 08/Sep/13  Resolved: 06/Jun/13

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

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


 Description   

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

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

Message:

Fixed some broken rendering on http://docs.doctrine-project.org/en/latest/reference/yaml-mapping.html



 Comments   
Comment by Doctrine Bot [ 06/Jun/13 ]

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

Comment by Marco Pivetta [ 06/Jun/13 ]

Merged at https://github.com/doctrine/doctrine2/commit/5c7b98b2a990a1d7a6140e2c875f5ab6c3dc6f9f





[DDC-2492] [GH-688] Implement QuoteStrategy on SqlWalker walkRangeVariableDeclaration Created: 06/Jun/13  Updated: 08/Sep/13  Resolved: 12/Jun/13

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

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


 Description   

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

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

Message:

Based on:
http://www.doctrine-project.org/jira/browse/DDC-1845
https://github.com/doctrine/doctrine2/commit/cb72219b118c158c9b5344c4b81ff2b1a9149ab0



 Comments   
Comment by Doctrine Bot [ 12/Jun/13 ]

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

Comment by Marco Pivetta [ 12/Jun/13 ]

Merged at https://github.com/doctrine/doctrine2/commit/6ef48561baa6cd6e3da1304d7d815883be9a9af1





[DDC-2494] Proxy getId not invoke convertToPHPValue on custom type Created: 08/Jun/13  Updated: 08/Sep/13  Resolved: 12/Jun/13

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

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


 Description   

I have a custom type tinyint:
https://gist.github.com/entering/3503d7458e5fbe2f6e02

I was using it a lot and when I updated to doctrine 2.4 beta it break some stuff. At the time i turn all on smallint and solve the problem, now I had time to look into it.

Example, entity Currency:

    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="tinyint", nullable=false, options={"unsigned": true})
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

    /**
     * @ORM\Column(name="temp", type="tinyint", nullable=false)
     */
    protected $temp;

Entity Campaign:

    /**
     * @var Currency
     *
     * @ORM\ManyToOne(targetEntity="Currency", inversedBy="campaigns")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="currency_id", referencedColumnName="id", nullable=false)
     * })
     */
    protected $currency;

When i have this piece of code:

var_dump($campaign->getCurrency()->getId());
var_dump($campaign->getCurrency()->getTemp());

I get:
string(1) "1"
int(5)

If I turn id into small int:
int(1)
int(5)

If I switch the order to:

var_dump($campaign->getCurrency()->getTemp());
var_dump($campaign->getCurrency()->getId());

As expected:
int(5)
int(1)

If I place a var_dump on convertToPHPValue I can see that is not being called on getId when getId is lazy.

This looks like a bug introduced when getId started being lazy to save queries.



 Comments   
Comment by Fabio B. Silva [ 10/Jun/13 ]

Before DCOM-96 we ignore custom type fields while looking for identifier getters.
It mean that, when an identifier getter is called the entity will be loaded from database, even though the identifier value is already known.
Then the Type#convertToPHPValue will be invoked..

After we move the proxy generation to common custom types are ignored and the database load its no longer triggered.

Comment by Eduardo Oliveira [ 10/Jun/13 ]

I understand the problem, because I was aware that getId() now doesn't load entity from DB, what is great in performance, I was expecting this for a while.

For me is really bad I cannot have ID's as tinyint (custom type), i suppose Doctrine doesn't support tinyint because is not present in all DB's, but some DB's like MySQL support it, I agree that Doctrine doesn't need to support all types out the box, but custom types should work exactly like native types, shouldn't be second class citizens.

If this is a limitation that is difficult to overpass and there are no plans to "fix" it, should be listed here: http://docs.doctrine-project.org/en/latest/reference/limitations-and-known-issues.html

And should be listed as BC in here: https://github.com/doctrine/doctrine2/blob/master/UPGRADE.md

If there are plans to fix this problem and is just a case of someone put hands on the code I can give it a shot even I'm not completely familiar with Doctrine code.

Comment by Marco Pivetta [ 10/Jun/13 ]

I don't think the bug is related with lazy loading. Identifiers are never hydrated into proxies anyway.

What the problem here seems to be is that the type conversion is not applied to meta columns.

You can check and see if there's code about type conversion in meta columns.

Comment by Eduardo Oliveira [ 10/Jun/13 ]

"What the problem here seems to be is that the type conversion is not applied to meta columns."

Marco I'm not sure If I follow you.

So when ID of entity Currency is a smallint a var_dump($campaign->getCurrency()) give this: https://gist.github.com/entering/5751908

  protected $id =>
  string(1) "1"

Is a string, the cast is done on getId()

Looking at the proxy created:

    /**
     * {@inheritDoc}
     */
    public function getId()
    {
       	if ($this->__isInitialized__ === false) {
            return (int)  parent::getId();
        }

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getId', array());

        return parent::getId();

The cast is written here: https://github.com/doctrine/doctrine2/blob/2.3/lib/Doctrine/ORM/Proxy/ProxyFactory.php#L259

Just to be sure I placed a var_dump inside convertToPHPValue of SmallIntType and on getId() is not called, but if I force the load of entity from DB (code below) converToPHPValue is called.

var_dump($campaign->getCurrency()->getCode());
var_dump($campaign->getCurrency()->getId());

So the problem here is that convertToPHPValue is never called on getId() on proxy when entity is not initialized, the problem is masked with the cast "written on hand" inside the getId().

The way I see it the getId() on proxy should all the time call convertToPHPValue, that way it would be correct with all types (native and custom).

The proxy with tinyint:

    /**
     * {@inheritDoc}
     */
    public function getId()
    {
        if ($this->__isInitialized__ === false) {
            return  parent::getId();
        }


        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getId', array());

        return parent::getId();
    }

Before custom tinyint was working on Identifiers because getId() would need to load entity from DB, the entity would be hydrate and the convertToPHPValue called at that time, now getId() doesn't load entity from DB so is never called.

To me a cast (int) on proxy that is decided according the name type is a ugly hack, inside if ($this->_isInitialized_ === false) it should call all the time convertToPHPValue.

Comment by Fabio B. Silva [ 11/Jun/13 ]

A possible solution : https://github.com/doctrine/doctrine2/pull/690

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

Fixed : https://github.com/doctrine/doctrine2/commit/6937061b23ec4de63081efac800415e09dcbcb4f





[DDC-2498] [GH-690] [DDC-2494] Apply type conversion to meta columns Created: 11/Jun/13  Updated: 08/Sep/13  Resolved: 12/Jun/13

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

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


 Description   

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

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

Message:

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



 Comments   
Comment by Doctrine Bot [ 12/Jun/13 ]

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

Comment by Marco Pivetta [ 12/Jun/13 ]

Merged at https://github.com/doctrine/doctrine2/commit/6937061b23ec4de63081efac800415e09dcbcb4f





[DDC-2499] [GH-691] IDENTITY function fix for Joined Inheritance Created: 12/Jun/13  Updated: 08/Sep/13  Resolved: 12/Jun/13

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

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


 Description   

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

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

Message:

In a joined inheritance scenario, the identity function implementation assumed the foreign key column was on the table corresponding to the (sub)class named in the select statement. If the relation was on a super-class incorrect sql was generated.



 Comments   
Comment by Doctrine Bot [ 12/Jun/13 ]

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

Comment by Marco Pivetta [ 12/Jun/13 ]

Merged at https://github.com/doctrine/doctrine2/commit/0248f743babbd9b8861ff744a25f006ce2b83f9d





[DDC-2502] [GH-694] [DDC-2478] Support null association comparison Created: 13/Jun/13  Updated: 08/Sep/13  Resolved: 14/Jun/13

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

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


 Description   

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

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

Message:

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



 Comments   
Comment by Doctrine Bot [ 14/Jun/13 ]

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

Comment by Fabio B. Silva [ 14/Jun/13 ]

Merged : https://github.com/doctrine/doctrine2/commit/f2f1d8986c288a437b81cd756d889aa47880d8b8





[DDC-2518] [GH-704] added badges stable release and total downloads Created: 19/Jun/13  Updated: 08/Sep/13  Resolved: 19/Jun/13

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

Type: Documentation Priority: Major
Reporter: Doctrine Bot Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:

you can see the preview here: https://github.com/liuggio/doctrine2/tree/patch-1



 Comments   
Comment by Doctrine Bot [ 19/Jun/13 ]

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

Comment by Marco Pivetta [ 19/Jun/13 ]

https://github.com/doctrine/doctrine2/commit/1382d766b09a04d504871bb50d519575ac553136





[DDC-2519] Unable to DQL SELECT PARTIAL entity with association identifier Created: 19/Jun/13  Updated: 08/Sep/13  Resolved: 23/Jun/13

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

Type: Bug Priority: Major
Reporter: Gordon Forsythe Assignee: Fabio B. Silva
Resolution: Fixed Votes: 0
Labels: None
Environment:

Ubuntu, OSX, PHP5.4.x



 Description   

Entity\Person: id, name, etc
Entity\User: person, admin, etc (person is the primary and association key)

Trying DQL:
SELECT PARTIAL u.

{person,admin}

FROM Entity\User u
will fail.



 Comments   
Comment by Fabio B. Silva [ 23/Jun/13 ]

Fixed : https://github.com/doctrine/doctrine2/commit/2ce72f38a2a13c665cd7e2ee5d79eb82d2c8003b





[DDC-2520] [GH-705] [DDC-2519] Partial association identifier Created: 20/Jun/13  Updated: 08/Sep/13  Resolved: 23/Jun/13

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

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


 Description   

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

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

Message:

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



 Comments   
Comment by Doctrine Bot [ 23/Jun/13 ]

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

Comment by Fabio B. Silva [ 23/Jun/13 ]

Merged : https://github.com/doctrine/doctrine2/commit/2ce72f38a2a13c665cd7e2ee5d79eb82d2c8003b





[DDC-2534] [GH-711] Coveralls code coverage Created: 28/Jun/13  Updated: 08/Sep/13  Resolved: 28/Jun/13

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

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


 Description   

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

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

Message:

This patch adds support for https://coveralls.io



 Comments   
Comment by Doctrine Bot [ 28/Jun/13 ]

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

Comment by Marco Pivetta [ 28/Jun/13 ]

Merged at https://github.com/doctrine/doctrine2/commit/8e1111c8d3f0281990ab4533aa42a6020c43abd0





[DDC-2415] CustomIdGenerator not inherited from MappedSuperclass Created: 25/Apr/13  Updated: 08/Sep/13  Resolved: 27/Apr/13

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.3.3
Fix Version/s: 2.4

Type: Bug Priority: Major
Reporter: Sebastian Calvo Assignee: Fabio B. Silva
Resolution: Fixed Votes: 0
Labels: orm


 Description   

I had a problem with a CUSTOM id generation mapping definition.
I have an abstract class and @MappedSuperclass which defines the id column as:

/**

  • @ORM\Id
  • @ORM\Column(name="ID", type="integer")
  • @ORM\GeneratedValue(strategy="CUSTOM")
  • @ORM\CustomIdGenerator(class="Infoil\Extensions\ExtensionsBundle\DoctrineIdGenerator\ZafiroIdGenerator")
  • @var int $id
    */
    The problem is that subclasses doesn't inherits the CustomIdGenerator annotation. I have traced the problem up to ClassMetadataFactory::doLoadMetadata.
    I had to change the second inner if statement as

if ($parent->isMappedSuperclass)

{ $class->setCustomRepositoryClass($parent->customRepositoryClassName); $class->setCustomGeneratorDefinition($parent->customGeneratorDefinition); <<<<< LINE ADDED }

to allow subclasses inherit the customGenerationdefinition.

Aside, the docblock annotation help doesn't includes the CustomIdGenerator tag.



 Comments   
Comment by Fabio B. Silva [ 27/Apr/13 ]

Fixed : https://github.com/doctrine/doctrine2/commit/d513e0f084eb4e67ccb42877b28a27d47a561665





[DDC-2513] [GH-702] ANSI compliant quote strategy Created: 18/Jun/13  Updated: 08/Sep/13  Resolved: 23/Jun/13

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

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


 Description   

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

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

Message:



 Comments   
Comment by Doctrine Bot [ 23/Jun/13 ]

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

Comment by Fabio B. Silva [ 23/Jun/13 ]

Merged : https://github.com/doctrine/doctrine2/commit/457036aacb660b21196d4fce7de215a943cc52e8





[DDC-2459] ANSI compliant quote strategy. Created: 17/May/13  Updated: 08/Sep/13  Resolved: 23/Jun/13

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

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


 Description   

In order to simplify and speed up the sql generation
an ANSI quote strategy would be useful.

The implementation would be something like :

<?php
class AnsiQuoteStrategy implements \Doctrine\ORM\Mapping\QuoteStrategy
{
    /**
     * {@inheritdoc}
     */
    public function getColumnName($fieldName, ClassMetadata $class, AbstractPlatform $platform)
    {
        return $class->fieldMappings[$fieldName]['columnName'];
    }

    /**
     * {@inheritdoc}
     */
    public function getTableName(ClassMetadata $class, AbstractPlatform $platform)
    {
        return $class->table['name'];
    }

    /**
     * {@inheritdoc}
     */
    public function getSequenceName(array $definition, ClassMetadata $class, AbstractPlatform $platform)
    {
        return $definition['sequenceName'];
    }

    /**
     * {@inheritdoc}
     */
    public function getJoinColumnName(array $joinColumn, ClassMetadata $class, AbstractPlatform $platform)
    {
        return $joinColumn['name'];
    }

    /**
     * {@inheritdoc}
     */
    public function getReferencedJoinColumnName(array $joinColumn, ClassMetadata $class, AbstractPlatform $platform)
    {
        return $joinColumn['referencedColumnName'];
    }

    /**
     * {@inheritdoc}
     */
    public function getJoinTableName(array $association, ClassMetadata $class, AbstractPlatform $platform)
    {
        return $association['joinTable']['name'];
    }

    /**
     * {@inheritdoc}
     */
    public function getIdentifierColumnNames(ClassMetadata $class, AbstractPlatform $platform)
    {
        return $class->identifier;
    }

    /**
     * {@inheritdoc}
     */
    public function getColumnAlias($columnName, $counter, AbstractPlatform $platform, ClassMetadata $class = null)
    {
        return $platform->getSQLResultCashing($columnName . $counter);
    }
}


 Comments   
Comment by Fabio B. Silva [ 23/Jun/13 ]

Fixed : https://github.com/doctrine/doctrine2/commit/457036aacb660b21196d4fce7de215a943cc52e8





[DDC-2625] [GH-764] Add table alias to column names Created: 20/Aug/13  Updated: 08/Sep/13  Resolved: 23/Aug/13

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

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


 Description   

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

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

Message:

`ManyToManyPersister` does not add table alias to column names in multi-table `SELECT` queries. This will cause SQL servers complain about condition columns in where clause are ambiguous.



 Comments   
Comment by Doctrine Bot [ 22/Aug/13 ]

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

Comment by Fabio B. Silva [ 23/Aug/13 ]

Closed, See https://github.com/doctrine/doctrine2/pull/764 for details...





[DDC-2626] [GH-765] Add table alias to column names for m2m persister (2.4) Created: 20/Aug/13  Updated: 08/Sep/13  Resolved: 23/Aug/13

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

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


 Description   

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

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

Message:

2.4 branch version of #764



 Comments   
Comment by Doctrine Bot [ 22/Aug/13 ]

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

Comment by Fabio B. Silva [ 23/Aug/13 ]

Closed, See https://github.com/doctrine/doctrine2/pull/765 for details..





[DDC-2627] [GH-766] Add table alias to column names for m2m persister (master) Created: 20/Aug/13  Updated: 08/Sep/13  Resolved: 23/Aug/13

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

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


 Description   

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

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

Message:

master branch version of #764



 Comments   
Comment by Doctrine Bot [ 22/Aug/13 ]

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

Comment by Fabio B. Silva [ 23/Aug/13 ]

Closed, See https://github.com/doctrine/doctrine2/pull/766 for details..





[DDC-2628] [GH-767] Fixing missing table aliases when using Many2Many persister. Created: 22/Aug/13  Updated: 08/Sep/13  Resolved: 23/Aug/13

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

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


 Description   

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

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

Message:



 Comments   
Comment by Doctrine Bot [ 22/Aug/13 ]

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

Comment by Fabio B. Silva [ 23/Aug/13 ]

Fixed by : https://github.com/doctrine/doctrine2/pull/767





[DDC-2503] [GH-695] Implemented support for RepositoryFactory. Created: 14/Jun/13  Updated: 07/Sep/13  Resolved: 18/Jun/13

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

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


 Description   

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

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

Message:

This allows anyone to override the default behavior to load Repositories.



 Comments   
Comment by Doctrine Bot [ 14/Jun/13 ]

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

Comment by Fabio B. Silva [ 18/Jun/13 ]

Merged : https://github.com/doctrine/doctrine2/commit/7903a2b5139e51b5dd7ed5ae164f7e0f3685dea7





[DDC-2638] [GH-770] Fix for entity generator discriminator column Created: 28/Aug/13  Updated: 07/Sep/13  Resolved: 07/Sep/13

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

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


 Description   

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

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

Message:

I was using the EntityGenerator to create class files from yaml when I realized php warnings like `PHP Warning: Illegal string offset 'name'` on the console. Warnings have also been emitted for the `type` and `length` fields.

The generated php file also contained a wrong annotation for the discriminator column:

  • @ORM\DiscriminatorColumn(name="s", type="s", length=s)

The single change in this pull request resolves the problem, so even the warnings disappear and the generated file contains the proper annotation.

An example yaml:

Subscription:
type: entity
table: subscriptions
id:
id:
type: integer
generator:
strategy: AUTO
fields:
created:
type: datetime
updated:
type: datetime
inheritanceType: SINGLE_TABLE
discriminatorColumn:
name: objectType
type: string
length: 255
discriminatorMap:
manyToOne:
user:
targetEntity: User
joinColumn:
name: user_id
referencedColumnName: id



 Comments   
Comment by Doctrine Bot [ 28/Aug/13 ]

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





[DDC-2640] [GH-772] DO NOT OVERRIDE CUSTOM TREE WALKERS IN getIterator() Created: 29/Aug/13  Updated: 07/Sep/13  Resolved: 29/Aug/13

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

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


 Description   

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

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

Message:



 Comments   
Comment by Doctrine Bot [ 29/Aug/13 ]

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

Comment by Doctrine Bot [ 29/Aug/13 ]

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

Comment by Doctrine Bot [ 29/Aug/13 ]

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

Comment by Marco Pivetta [ 29/Aug/13 ]

Merged: https://github.com/doctrine/doctrine2/commit/6f025f78ec9408cc78b0169fda2c86f35c8fd3f4

Comment by Benjamin Eberlei [ 07/Sep/13 ]

Merged into 2.4





[DDC-2650] [GH-775] Update create bug script Created: 04/Sep/13  Updated: 04/Sep/13  Resolved: 04/Sep/13

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

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


 Description   

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

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

Message:

This script is using the first argument twice and ignoring the second argument completely.



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

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

Comment by Marco Pivetta [ 04/Sep/13 ]

Merged: https://github.com/doctrine/doctrine2/commit/0a9ff77303e515bf8b1d610ff5cdcf61c82b0d09





[DDC-2539] ResultVariable cannot be used in Like expressions Created: 02/Jul/13  Updated: 26/Aug/13  Resolved: 26/Aug/13

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

Type: Bug Priority: Major
Reporter: Serge Liszewski Assignee: Marco Pivetta
Resolution: Duplicate Votes: 0
Labels: dql, orm, querybuilder,


 Description   

It is not possible to use ResultVariable in a like expression. For exemple :

$qb ->select('c', 'SQRT(c.id) AS test')
->from('SomeClass', 'c')
->having('test LIKE \'%4%\'');

return [Syntax Error] line 0, col 91: Error: Expected Literal, got 'LIKE'

$qb ->select('c')
->from('SomeClass', 'c')
->having('c.id LIKE \'%4%\'');

works, and :

$qb ->select('c', 'SQRT(c.id) AS test')
->from('SomeClass', 'c')
->having('test = 4');

works

Changing Doctrine\ORM\Query\Parser LikeExpression function fix the problem (but has maby other consequences) :

by replacing : "$stringExpr = $this->StringExpression();"
by :
$peek = $this->_lexer->glimpse();
if($peek['value'] == 'LIKE')

{ // Simple Expression $stringExpr = $this->ArithmeticExpression(); }

else

{ $stringExpr = $this->StringExpression(); }

 Comments   
Comment by Serge Liszewski [ 26/Aug/13 ]

After working on this issue, i really think it's a bug. I just add more details on the description

Comment by Marco Pivetta [ 26/Aug/13 ]

Duplicate of DDC-2615 (solved in master)





[DDC-2583] [GH-742] Cleaned up events.rst Created: 30/Jul/13  Updated: 25/Aug/13  Resolved: 25/Aug/13

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

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


 Description   

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

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

Message:

Was a mix-up between TestEventSubscriber and EventTest (e.g. the definition of TestEventSubscriber referenced TestEvent::preFoo, which did not exist). To clarify this I've renamed EventTest to TestEvent.

Tried to clarify the text in the Naming Convention section.

Added note that onClear is not a lifecycle callback.

Tried to clarify the definition of Lifecycle Callbacks.

Separated key/value descriptions into XML and YAML parts since the details are different

Added note in Implementing Event Listeners section that since 2.4 you do have access to EntityManager and UnitOfWork from lifecycle callbacks.

Added example about how to use the computed changeset to modify a primitive value in preUpdate section

Added naming convention example to Entity listeners class section

The other changes are typos and small fixes.



 Comments   
Comment by Doctrine Bot [ 25/Aug/13 ]

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

Comment by Marco Pivetta [ 25/Aug/13 ]

Merged: https://github.com/doctrine/doctrine2/commit/e2a67c2f1c1f2f7e670264c52294968963f3b242





[DDC-2623] [GH-763] Entity generator - trait in parent class Created: 20/Aug/13  Updated: 25/Aug/13  Resolved: 25/Aug/13

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

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


 Description   

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

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

Message:

Fix for the [problem](https://github.com/doctrine/doctrine2/pull/632#issuecomment-22927500) mentioned by @AlexanderParker about my previous PR, #632.



 Comments   
Comment by Doctrine Bot [ 20/Aug/13 ]

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

Comment by Marco Pivetta [ 25/Aug/13 ]

Merged: https://github.com/doctrine/doctrine2/commit/44f9952063efd0da7295b0ac7ef802bbd3179958





[DDC-1844] [GH-360] [DDC-1840] Implemented parameters as a collection. Created: 28/May/12  Updated: 25/Aug/13  Resolved: 08/Jun/12

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

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


 Description   

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

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

Message:



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

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

Comment by Guilherme Blanco [ 08/Jun/12 ]

Merged

Comment by Doctrine Bot [ 24/Aug/13 ]

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

Comment by Marco Pivetta [ 25/Aug/13 ]

Merged @ https://github.com/doctrine/dbal/commit/7ffb2701931aeae3bb32fa2012b9a575f3a7929b





[DDC-717] Do not use files when using proxy autogeneration Created: 22/Jul/10  Updated: 20/Aug/13  Resolved: 20/Aug/13

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

Type: Improvement Priority: Major
Reporter: Jaka Jancar Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 2
Labels: None


 Description   

Proxy classes are generated in less than 1ms for me. I prefer to not have a "build" step to reducing loading time by a milisecond, so I use autogenerate.

For users like me, wouldn't it be nicer if we wouldn't even have to configure a proxy dir and those files were never written (since they're not read more than once anyway)?



 Comments   
Comment by Jaka Jancar [ 22/Jul/10 ]

This very minimal patch removes the use of these temporary files:

--- library/Doctrine/ORM/Proxy/ProxyFactory.php	(revision 2)
+++ library/Doctrine/ORM/Proxy/ProxyFactory.php	(working copy)
@@ -78,9 +78,8 @@
         $fqn = $this->_proxyNamespace . '\\' . $proxyClassName;
 
         if ($this->_autoGenerate && ! class_exists($fqn, false)) {
-            $fileName = $this->_proxyDir . DIRECTORY_SEPARATOR . $proxyClassName . '.php';
-            $this->_generateProxyClass($this->_em->getClassMetadata($className), $proxyClassName, $fileName, self::$_proxyClassTemplate);
-            require $fileName;
+            $file = $this->_generateProxyClass($this->_em->getClassMetadata($className), $proxyClassName, null, self::$_proxyClassTemplate);
+            eval('?>'.$file);
         }
 
         if ( ! $this->_em->getMetadataFactory()->hasMetadataFor($fqn)) {
@@ -144,6 +143,9 @@
 
         $file = str_replace($placeholders, $replacements, $file);
 
+        if ($fileName === null)
+            return $file;
+
         file_put_contents($fileName, $file);
     }
 
Comment by Benjamin Eberlei [ 23/Jul/10 ]

The proxy dir is used for the "doctrine orm:generate-proxies" command in the case of "autogenerate= false", so you need to define it anyways.

You have to use proxies, the option is not for Proxy yes/no. If you have autogenerate=false and doctrine requires a proxy for a use case but can't find it you will get a fatal error.

Comment by Benjamin Eberlei [ 23/Jul/10 ]

I just saw the eval() keyword, ieeks It could maybe be a convenience option for those that don't want to use proxy direcotiries, however i am not sure.

Comment by Jaka Jancar [ 23/Jul/10 ]

eval() is no different than writing code to a file and using require().

When using runtime-generated proxies, there are no benefits (that I know of) from writing them to a file. The disadvantages are:

  • slower because of write disk access
  • has problems with high concurrency, unless special care is taken (DDC-716)
  • potentially has permission problems if code is executed by different users (e.g. nobody for a daemon and www-data for http)
  • requires setup of a writable directory

This is a nicer patch, which makes _generateProxyClass() return a string, just like other _generate* methods:

--- library/Doctrine/ORM/Proxy/ProxyFactory.php	(revision 2)
+++ library/Doctrine/ORM/Proxy/ProxyFactory.php	(working copy)
@@ -78,9 +78,8 @@
         $fqn = $this->_proxyNamespace . '\\' . $proxyClassName;
 
         if ($this->_autoGenerate && ! class_exists($fqn, false)) {
-            $fileName = $this->_proxyDir . DIRECTORY_SEPARATOR . $proxyClassName . '.php';
-            $this->_generateProxyClass($this->_em->getClassMetadata($className), $proxyClassName, $fileName, self::$_proxyClassTemplate);
-            require $fileName;
+            $code = $this->_generateProxyClass($this->_em->getClassMetadata($className), $proxyClassName);
+            eval($code);
         }
 
         if ( ! $this->_em->getMetadataFactory()->hasMetadataFor($fqn)) {
@@ -107,19 +106,19 @@
         foreach ($classes as $class) {
             $proxyClassName = str_replace('\\', '', $class->name) . 'Proxy';
             $proxyFileName = $proxyDir . $proxyClassName . '.php';
-            $this->_generateProxyClass($class, $proxyClassName, $proxyFileName, self::$_proxyClassTemplate);
+            $code = $this->_generateProxyClass($class, $proxyClassName);
+            file_put_contents($proxyFileName, "<?php\n" . $code);
         }
     }
 
     /**
      * Generates a proxy class file.
      *
-     * @param $class
-     * @param $originalClassName
+     * @param ClassMetadata $class
      * @param $proxyClassName
-     * @param $file The path of the file to write to.
+     * @return string The code of the generated methods.
      */
-    private function _generateProxyClass($class, $proxyClassName, $fileName, $file)
+    private function _generateProxyClass(ClassMetadata $class, $proxyClassName)
     {
         $methods = $this->_generateMethods($class);
         $sleepImpl = $this->_generateSleep($class);
@@ -142,9 +141,9 @@
             $methods, $sleepImpl
         );
 
-        $file = str_replace($placeholders, $replacements, $file);
+        $file = str_replace($placeholders, $replacements, self::$_proxyClassTemplate);
 
-        file_put_contents($fileName, $file);
+        return $file;
     }
 
     /**
@@ -244,8 +243,7 @@
 
     /** Proxy class code template */
     private static $_proxyClassTemplate =
-'<?php
-
+'
 namespace <namespace>;
 
 /**
Comment by Benjamin Eberlei [ 24/Jul/10 ]

Scheduled usage of eval() for 2.1, if the following conditions exist:

1. Autogenerate is set to TRUE
2. No Proxy Directory is configured.

Comment by Jaka Jancar [ 24/Jul/10 ]

Great, this is even better. This way you can have 1) autogenerated in ram-only, 2) autogenerated in files and 3) pregenerated.

And the minimal amount of config needed to get up and running is reduced, which is always nice.

Comment by Benjamin Eberlei [ 24/Jul/10 ]

you should know though, eval is dead slow. It generates the necessary proxies on EACH request and that cannot be cached in APC.

Comment by Jaka Jancar [ 24/Jul/10 ]

It's no slower than current autogeneration (file_put_contents+require). TBH, I don't know why anyone would want to use that over eval(), but I don't mind it being there.

Pre-generation is, of course, a different thing. Seems like a valid tradeoff to offer: build/a bit of config/better perfomance vs. no build/no config/potentially slower.

Comment by Benjamin Eberlei [ 24/Jul/10 ]

Yes, that is because file_put_contents + require is a development only strategy. The manual clearly states that autogenerate has to be false in production.

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

Using eval() instead of producing and requiring the file in the case of enabled auto-generation of proxy classes sounds like a good improvement for 2.1 to make proxies more transparent during deveopment and for anyone for whom performance is no issue.

I'm increasing the priority as I think it is easy to implement for 2.1 and a good enhancement.

Comment by Karsten Dambekalns [ 09/Feb/11 ]

A note on why having the proxies written to a file can be useful even with autogenerate being on: it makes it really easy to check the proxy code being generated. I use that a lot currently.

The solution suggested, giving three possibilities is cool, though.





[DDC-2235] Single table inheritance discriminator in WHERE when using arbitrary join syntax Created: 11/Jan/13  Updated: 20/Aug/13  Resolved: 16/Aug/13

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

Type: Bug Priority: Major
Reporter: Jordi Forns Assignee: Guilherme Blanco
Resolution: Fixed Votes: 6
Labels: None

Issue Links:
Duplicate
duplicates DDC-1940 Doctrine DQL: erroneous sql generatio... Resolved

 Description   

The condition on the discriminator column is placed in the WHERE clause when using arbitrary join syntax, which renders LEFT JOINs useless.

Given these classes:
A - no inheritance
B1 - abstract, root of a hierarchy, discriminator column is named 'type'
I setup a query builder like this:

$qb->select('a.id AS idA, b.id AS idB')
    ->from('\Entity\A', 'a')
    ->leftJoin('\Entity\B1', 'b', \Doctrine\ORM\Query\Expr\Join::WITH, 'a.something=b.something');
And the SQL Doctrine generates is something like this:
SELECT a.id, b.id FROM a LEFT JOIN b ON (a.something=b.something) WHERE b.type IN ('1', '2', '3')

The problems is that the WHERE condition makes the left join useless.

The condition on the discriminator column should be placed in the JOIN clause to avoid the problem.



 Comments   
Comment by Ondrej Hlavaty [ 10/Feb/13 ]

Can this be somehow worked around? If not, it is really serious problem...

Comment by Jordi Forns [ 18/Feb/13 ]

I couldn't find any workaround.
Trying to force the 'type' condition in the join clause resulted useless as Doctrine would add the 'where' condition regardless.

Comment by Michel Salib [ 22/Mar/13 ]

Easier way to workaround right now, is to declare a OneToMany from class A to class B on a protected field (no need of getter or setter). That way you can do classic join via relationship transversing and then the condition will be placed in the ON part of the query.

Comment by Yuta Konishi [ 01/Apr/13 ]

I could access with below codes. You should use RAW SQL it is easy solution I guess. good luck.