public function onPostHydrate(HydrationEvent $event)
    {
        $entity = $event->getSubject();
        if (!$entity instanceof Entity\Users) {
            return;
        }

        // Ensure Permissions::ROLE_EVERYONE always exists
        $roles = $entity->getRoles();
        if (!in_array(Permissions::ROLE_EVERYONE, $roles)) {
            $roles[] = Permissions::ROLE_EVERYONE;
            $entity->setRoles($roles);
        }
    }
public function onPostHydrate(HydrationEvent $event)
    {
        $entity = $event->getSubject();
        if (!$entity instanceof Entity\Users) {
            return;
        }

        // Ensure Permissions::ROLE_EVERYONE always exists
        $roles = $entity->getRoles();
        if (!in_array(Permissions::ROLE_EVERYONE, $roles)) {
            $roles[] = Permissions::ROLE_EVERYONE;
            $entity->setRoles($roles);
        }
    }
public function onPostHydrate ( HydrationEvent $ event ) { $ entity = $ event -> getSubject ( ) ; if ( ! $ entity instanceof Entity \ Users ) { return ; } // Ensure Permissions::ROLE_EVERYONE always exists $ roles = $ entity -> getRoles ( ) ; if ( ! in_array ( Permissions :: ROLE_EVERYONE , $ roles ) ) { $ roles [ ] = Permissions :: ROLE_EVERYONE ; $ entity -> setRoles ( $ roles ) ; } }
Post hydration storage event.

@param HydrationEvent $event
Post hydration storage event .