Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid prefixing columns when false is assigned to column-prefix #1238

Merged
merged 9 commits into from
Jan 8, 2015

Conversation

andreyvital
Copy link
Contributor

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

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

@Ocramius suggested on issue about introducing a new attribute called use-column-prefix, I'd say that keeping the same attribute as in others drivers would be better.

That's it.

@doctrinebot
Copy link

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-3477

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

@Ocramius
Copy link
Member

Ocramius commented Jan 8, 2015

Looking good: 👍

@CentaurWarchief as usual, I have to ask for tests.

EDIT: the fix is flawed for now. See inline comments

@Ocramius Ocramius self-assigned this Jan 8, 2015
@@ -833,6 +842,6 @@ protected function evaluateBoolean($element)
{
$flag = (string)$element;

return ($flag === true || $flag == "true" || $flag == "1");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove the simple boolean true case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because (string) $element never will be true. They're different types.

$ php -r 'var_dump((string) 'true' === true);' // bool(false)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point

: null;

$useColumnPrefix = isset($embeddedMapping['use-column-prefix'])
? $this->evaluateBoolean(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for the line-wrap for the parameters here

@Ocramius Ocramius merged commit a701c9d into doctrine:master Jan 8, 2015
Ocramius added a commit that referenced this pull request Jan 8, 2015
Ocramius added a commit that referenced this pull request Jan 8, 2015
…="true"` and `use-column-prefix="false"` xml mappings
Ocramius added a commit that referenced this pull request Jan 8, 2015
@Ocramius
Copy link
Member

Ocramius commented Jan 8, 2015

@CentaurWarchief merged, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants