+
+ /**
+ * {@inheritdoc}
+ */
+ public function preUpdate(PreUpdateEventArgs $eventArgs) {
+ //Check that we have a group instance
+ if (($user = $eventArgs->getObject()) 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 {
+ //XXX: $prefix = 'ROLE_' set in Role*Voter classes
+ return 'ROLE_'.strtoupper($this->title);
+ }