Rename methods
This commit is contained in:
parent
7e06943be1
commit
5e9dc48896
|
@ -23,12 +23,12 @@ final class PushPostToSocialMediaOnceItIsPublished implements EventSubscriberInt
|
|||
*/
|
||||
public static function getSubscribedEvents() {
|
||||
return [
|
||||
HookEventDispatcherInterface::ENTITY_INSERT => 'onEntityUpdate',
|
||||
HookEventDispatcherInterface::ENTITY_UPDATE => 'onEntityUpdate',
|
||||
HookEventDispatcherInterface::ENTITY_INSERT => 'pushPost',
|
||||
HookEventDispatcherInterface::ENTITY_UPDATE => 'pushPost',
|
||||
];
|
||||
}
|
||||
|
||||
public function onEntityUpdate(AbstractEntityEvent $event): void {
|
||||
public function pushPost(AbstractEntityEvent $event): void {
|
||||
$entity = $event->getEntity();
|
||||
|
||||
if ($entity->getEntityTypeId() != 'node') {
|
||||
|
|
|
@ -17,11 +17,11 @@ final class SortTagsAlphabeticallyWhenPostIsSaved implements EventSubscriberInte
|
|||
*/
|
||||
public static function getSubscribedEvents() {
|
||||
return [
|
||||
HookEventDispatcherInterface::ENTITY_PRE_SAVE => 'onEntityPreSave',
|
||||
HookEventDispatcherInterface::ENTITY_PRE_SAVE => 'sortTags',
|
||||
];
|
||||
}
|
||||
|
||||
public function onEntityPresave(AbstractEntityEvent $event): void {
|
||||
public function sortTags(AbstractEntityEvent $event): void {
|
||||
$entity = $event->getEntity();
|
||||
|
||||
if ($entity->getEntityTypeId() != 'node') {
|
||||
|
|
Loading…
Reference in a new issue