+
+ /**
+ * {@inheritdoc}
+ */
+ public function preUpdate(PreUpdateEventArgs $eventArgs) {
+ //Check that we have a group instance
+ if (($user = $eventArgs->getEntity()) instanceof Group) {
+ //Set updated value
+ $user->setUpdated(new \DateTime('now'));
+ }
+ }
+
+ /**
+ * Returns a string representation of the group
+ *
+ * @return string
+ */
+ public function __toString(): string {
+ return $this->title;
+ }
+
+ /**
+ * Get role
+ *
+ * @return string
+ */
+ public function getRole(): string {
+ return 'ROLE_'.strtoupper($this->title);
+ }