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

Remove duplicated getType() from generated content entities #3235

Merged
merged 1 commit into from
Mar 25, 2017

Conversation

pfrenssen
Copy link
Contributor

Currently when a content entity is generated that supports bundles, this piece of code is generated in it:

/**
 * {@inheritdoc}
 */
public function getType() {
  return $this->bundle();
}

This getter is duplicating EntityInterface::bundle() which is the standard way of getting the bundle from any entity.

Having this getType() available only on entities generated by Drupal Console is confusing, since it is missing from core entities. It also doesn't serve any purpose, it is just duplicating existing functionality.

@jmolivas jmolivas added this to the 1.0.0-rc17 milestone Mar 20, 2017
@jmolivas jmolivas merged commit 1c481e5 into hechoendrupal:master Mar 25, 2017
@jmolivas
Copy link
Member

@pfrenssen nice catch. Thanks for your contribution, your PR was merged. This will be included on the next release.

@pfrenssen pfrenssen deleted the remove-gettype branch March 29, 2017 09:11
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.

2 participants