Skip to content

enable set visibilty of class fields in EntityGenerator#253

Merged
beberlei merged 5 commits intodoctrine:masterfrom
mrmkrs:protectedfields
Jan 28, 2012
Merged

enable set visibilty of class fields in EntityGenerator#253
beberlei merged 5 commits intodoctrine:masterfrom
mrmkrs:protectedfields

Conversation

@mrmkrs
Copy link
Contributor

@mrmkrs mrmkrs commented Jan 10, 2012

This commit makes it possible to set the field visibility to private or protected of the generated entities (generated with EntityGenerator).
For example: One can then generate a "DefaultUser" class with protected fields, and subclass it. (Class User extends DefaultUser). That way you can regenerate the entities with Doctrine over and over again without interfering with additional developer code.

Also, some project codingstandards say "protected over private" so all entities should have protected fields so they can always be extended.

See: groups.google.com/group/doctrine-user/browse_thread/thread/77609f754ddea7de/051cfdbdf2cfaa03

Copy link
Member

Choose a reason for hiding this comment

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

wrong indentation. it should use 4 spaces, not tabs

tabs -> spaces
added class constants
updated phpdoc
@mrmkrs
Copy link
Contributor Author

mrmkrs commented Jan 13, 2012

I've removed whitespace and converted tabs to spaces. Added the class constant.
Regarding your note about phpdoc comment: Looking at other code all phpdoc has a return void in the comment, so i've copied that part.

Choose a reason for hiding this comment

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

Missing space between if and (

@mrmkrs
Copy link
Contributor Author

mrmkrs commented Jan 13, 2012

fixed the issues!

Copy link
Member

Choose a reason for hiding this comment

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

you should use the class constants here, and you should use a strict comparison (!==)

@mrmkrs
Copy link
Contributor Author

mrmkrs commented Jan 13, 2012

done!

Copy link
Member

Choose a reason for hiding this comment

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

should be self:: instead of EntityGenerator::

@mrmkrs
Copy link
Contributor Author

mrmkrs commented Jan 13, 2012

replaced EntityGenerator:: with self::

beberlei added a commit that referenced this pull request Jan 28, 2012
enable set visibilty of class fields in EntityGenerator
@beberlei beberlei merged commit 3c4d2cd into doctrine:master Jan 28, 2012
@Ocramius
Copy link
Member

@stefantalen please use the mailing list to ask questions, and not the issue tracker

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.

5 participants