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

DDC-3608: [GH-1327] Properly generate default value from yml & xml mapping #4432

Closed
doctrinebot opened this issue Mar 10, 2015 · 5 comments
Closed
Assignees
Labels
Milestone

Comments

@doctrinebot
Copy link

Jira issue originally created by user @doctrinebot:

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

Url: #1327

Message:

Yaml & Xml mapping which define default value for a field aren't properly generated in the entity class by the EntityGenerator.

This is how the documentation says to define a default value in xml:

<field name="login_count" type="integer" nullable="false">
    <options>
        <option name="default">0</option>
    </options>
</field>

and in yml:

    loginCount:
      type: integer
      column: login_count
      nullable: false
      options:
        default: 0

Both generates this field mapping (aka $fieldMapping):

array(5) {
  'fieldName' =>
  string(11) "login_count"
  'type' =>
  string(7) "integer"
  'nullable' =>
  bool(false)
  'options' =>
  array(1) {
    'default' =>
    string(1) "0"
  }
  'columnName' =>
  string(11) "login_count"
}

But the EntityGenerator check the default value in the wrong place, in $fieldMapping['default'] instead of $fieldMapping['options']['default'].

This is related to :

@doctrinebot
Copy link
Author

@doctrinebot
Copy link
Author

Comment created by @doctrinebot:

A related Github Pull-Request [GH-1327] was labeled:
#1327

@doctrinebot
Copy link
Author

Comment created by @doctrinebot:

A related Github Pull-Request [GH-1327] was assigned:
#1327

@doctrinebot
Copy link
Author

Comment created by @doctrinebot:

A related Github Pull-Request [GH-1327] was closed:
#1327

@doctrinebot
Copy link
Author

Issue was closed with resolution "Fixed"

@doctrinebot doctrinebot added this to the 2.4.8 milestone Dec 6, 2015
@doctrinebot doctrinebot added the Bug label Dec 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants