aclMapper = $aclMapper; $this->circleService = $circlesService; } public function getName() { return 'Cleanup Deck ACL entries for circles which have been already deleted'; } public function run(IOutput $output) { if (!$this->circleService->isCirclesEnabled()) { return; } foreach ($this->aclMapper->findByType(Acl::PERMISSION_TYPE_CIRCLE) as $acl) { if ($this->circleService->getCircle($acl->getParticipant()) === null) { $this->aclMapper->delete($acl); $output->info('Removed circle with id ' . $acl->getParticipant()); } } } }