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

Allow overriding of the Migration template #391

Merged
merged 1 commit into from
Dec 16, 2015
Merged

Allow overriding of the Migration template #391

merged 1 commit into from
Dec 16, 2015

Conversation

jeromegamez
Copy link
Contributor

Retrieving the template through a method instead of accessing the private variable directly enables the extension of the "Generate" command.

As an example: in kreait/ezpublish-migrations-bundle, I have created a custom Migration class and a custom generate command, so that a Version can perform needed actions automatically and provide helper methods.

At the moment, it would be necessary to duplicate the generateMigrationmethod.

With the change from this PR, someone extending the GenerateCommand would just have to override the getTemplate method.

Retrieving the template through a method instead of accessing the private variable directly enables the extension of the "Generate" command.
mikeSimonson added a commit that referenced this pull request Dec 16, 2015
…template

Allow overriding of the Migration template
@mikeSimonson mikeSimonson merged commit 80792f4 into doctrine:master Dec 16, 2015
@mikeSimonson
Copy link
Contributor

@jeromegamez Thanks.

For the record we hope to make that easier for you for the next version of doctrine migrations.

@jeromegamez
Copy link
Contributor Author

That was quick, thank you! ❤️

@jeromegamez jeromegamez deleted the feature/overridable_version_template branch December 16, 2015 10:21
@mikeSimonson
Copy link
Contributor

no problems

@mikeSimonson mikeSimonson added this to the 1.3.0 milestone Jan 25, 2016
@Gemorroj
Copy link

👍

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