-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
add loadRevision functionality #5717
Conversation
@@ -308,7 +308,14 @@ public function makeEntitiesAvailableWithShortClassNames(): void | |||
foreach ($this->entityTypeManager->getDefinitions() as $definition) { | |||
$class = $definition->getClass(); | |||
$parts = explode('\\', $class); | |||
class_alias($class, array_pop($parts)); | |||
eval(sprintf('class %s extends \%s { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs code comment about what the heck we are doing. Also, can you think of a more elegant way than eval?
I have some final entity classes. this blows up on that. |
Follow-up to drush-ops#5717
You drank too much of the upstream kool aid to use final classes. |
I always use final classes for custom entities. And in the case of the example contrib config entities, I don't want to have to worry about BC with some strange use case extending my entity classes. Easier to just mark final. |
/me shrugs roll it back if you want, wouldn't be the first case this private and final idiocy ruins the party I even wrote a pleading letter to php internals to give an out for readonly classes but they of course wouldn't listen yay for theory to win over practice |
* Handle final entity classs Follow-up to #5717 * Update src/Commands/core/CliCommands.php
next step in the entity work is to add Paragraph::loadRevision. We can just steal the code from EntityBase::load(), wrap it in eval and boom.