@@ 81-89 (lines=9) @@ | ||
78 | /** |
|
79 | * @param LifecycleEventArgs $args |
|
80 | */ |
|
81 | public function prePersist(LifecycleEventArgs $args) |
|
82 | { |
|
83 | $entity = $args->getEntity(); |
|
84 | ||
85 | if ($entity instanceof NodeTranslation) { |
|
86 | $this->setSlugWhenEmpty($entity, $args->getEntityManager()); |
|
87 | $this->ensureSlugIsSlugified($entity); |
|
88 | } |
|
89 | } |
|
90 | ||
91 | /** |
|
92 | * @param LifecycleEventArgs $args |
|
@@ 94-102 (lines=9) @@ | ||
91 | /** |
|
92 | * @param LifecycleEventArgs $args |
|
93 | */ |
|
94 | public function preUpdate(LifecycleEventArgs $args) |
|
95 | { |
|
96 | $entity = $args->getEntity(); |
|
97 | ||
98 | if ($entity instanceof NodeTranslation) { |
|
99 | $this->setSlugWhenEmpty($entity, $args->getEntityManager()); |
|
100 | $this->ensureSlugIsSlugified($entity); |
|
101 | } |
|
102 | } |
|
103 | ||
104 | /** |
|
105 | * @param NodeTranslation $nodeTranslation |