Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Update JoinColumn.php #993

Closed
wants to merge 1 commit into from

4 participants

KamilKopaczyk doctrinebot Marco Pivetta Guilherme Blanco
KamilKopaczyk

If $referencedColumnName = 'id' by default, it doesn't make sense to make checks like:

if (empty($joinColumn['referencedColumnName'])) {

(ClassMetaDataInfo file)


Considering you map your column

@ORM\JoinColumn(onDelete="CASCADE")

You'll get JoinColumn with 'id' value, which doesn't let doctrine use naming strategies for referenced column names

KamilKopaczyk KamilKopaczyk Update JoinColumn.php
If $referencedColumnName = 'id' by default, it doesn't make sense to make checks like:
```php
if (empty($joinColumn['referencedColumnName'])) {
```
(ClassMetaDataInfo file)

-----
Considering you map your column
```
@ORM\JoinColumn(onDelete="CASCADE")
```
You'll get JoinColumn with 'id' value, which doesn't let doctrine use naming strategies for referenced column names
786678c
doctrinebot
Collaborator

Hello,

thank you for creating this pull request. I have automatically opened an issue
on our Jira Bug Tracker for you. See the issue link:

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

We use Jira to track the state of pull requests and the versions they got
included in.

Marco Pivetta
Owner

@KamilKopaczyk a functional test for this change would be required. I know what the issue is, but it will prevent regressions.

Guilherme Blanco

Unfortunately, while this is true for Annotations (it can never be empty), it is not for XML, YAML and PHP itself.
When using Annotations, we keep convention over configuration as the standard, providing the default id, while we require further configuration on other drivers.

Closing as invalid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 28, 2014
  1. KamilKopaczyk

    Update JoinColumn.php

    KamilKopaczyk authored
    If $referencedColumnName = 'id' by default, it doesn't make sense to make checks like:
    ```php
    if (empty($joinColumn['referencedColumnName'])) {
    ```
    (ClassMetaDataInfo file)
    
    -----
    Considering you map your column
    ```
    @ORM\JoinColumn(onDelete="CASCADE")
    ```
    You'll get JoinColumn with 'id' value, which doesn't let doctrine use naming strategies for referenced column names
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/Doctrine/ORM/Mapping/JoinColumn.php
2  lib/Doctrine/ORM/Mapping/JoinColumn.php
View
@@ -33,7 +33,7 @@
/**
* @var string
*/
- public $referencedColumnName = 'id';
+ public $referencedColumnName;
/**
* @var boolean
Something went wrong with that request. Please try again.