@DI\Observe("claroline_groups_delete")

@param GenericDataEvent $event
197200
public function onDelete(GenericDataEvent $event)
    {
        /** @var Group[] $groups */
        $groups = $event->getData();

        $ids = [];
        foreach ($groups as $group) {
            $ids[] = $group->getId();
        }

        $this->manager->removeTaggedObjectsByClassAndIds(Group::class, $ids);
    }
384387
public function afterDelete(Event $event, EntityInterface $entity) {
		if ($this->_checkEvent($event)) {
			$event->result = $this->_deleteFile($event);
			$event->stopPropagation();
		}
	}
397477
public function on($event, Closure $callback)
    {
        if (!in_array($event, ['*', 'modify', 'delete', 'create'])) {
            throw new RuntimeException('Could not bind to unknown event '.$event);
        }

        $this->registerBinding($event, $callback);
    }
50996
public function onDelete(DeleteResourceEvent $event)
    {
        $this->om->remove($event->getResource());
        $event->stopPropagation();
    }
84134
public function delete(AttributeAvDeleteEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        if (null !== ($attribute = AttributeAvQuery::create()->findPk($event->getAttributeAvId()))) {
            $attribute
                ->setDispatcher($dispatcher)
                ->delete()
            ;

            $event->setAttributeAv($attribute);
        }
    }
1299289
public static function remove(\core\event\base $event) {
        global $DB;

        $DB->delete_records(self::$table, array('cmid' => $event->contextinstanceid));
    }
657857
public function onReflectError(GenericEvent $event)
    {
        $context = $event->getArguments();
        $this->logger->error('Parser has detected an error on file "{file}". {error}', $context);
    }
937675
public function preDelete(DeleteEvent $event)
    {
        /** @var Organization $organization */
        $organization = $event->getObject();
        if ($organization->isDefault()) {
            $event->block();

            // we can also throw an exception
        }

        $keys = $this->om->getRepository(CryptographicKey::class)->findBy(['organization' => $organization]);

        foreach ($keys as $key) {
            $this->crud->delete($key);
        }
    }
346771
public function delete(CurrencyDeleteEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        if (null !== ($currency = CurrencyQuery::create()->findPk($event->getCurrencyId()))) {
            if ($currency->getByDefault()) {
                throw new \RuntimeException(
                    Translator::getInstance()->trans('It is not allowed to delete the default currency')
                );
            }

            $currency
                ->setDispatcher($dispatcher)
                ->delete()
            ;

            $event->setCurrency($currency);
        }
    }
334570
public function onDelete(DeleteResourceEvent $event)
    {
        $workspaceCode = $event->getResource()
            ->getResourceNode()
            ->getWorkspace()
            ->getCode();
        $pathName = $this->container->getParameter('claroline.param.files_directory') .
            DIRECTORY_SEPARATOR .
            $event->getResource()->getHashName();

        if (file_exists($pathName)) {
            $event->setFiles(array($pathName));
        }

        $event->stopPropagation();
    }
287508
public function deleteMetadata(EventInterface $event) {
        $request = $event->getRequest();

        $event->getDatabase()->deleteMetadata(
            $request->getUser(),
            $request->getImageIdentifier()
        );

        $event->getDatabase()->setLastModifiedNow(
            $request->getUser(),
            $request->getImageIdentifier()
        );
    }
1098560
public function onDelete(DeleteResourceEvent $event)
    {
        $this->manager->delete($event->getResource());
        $event->stopPropagation();
    }
1345350
public function delete(EventInterface $event) {
        $event->getManager()->trigger('db.metadata.delete');
        $event->getResponse()->setModel(new Model\Metadata());
    }
1311442
public function onRetrieveTags(GenericDatasEvent $event)
    {
        $tags = array();
        $tagsName = array();
        $datas = $event->getDatas();

        if (is_array($datas)) {
            $user = isset($datas['user']) ? $datas['user'] : null;
            $search = isset($datas['search']) ? $datas['search'] : '';
            $withPlatform = isset($datas['with_platform']) && $datas['with_platform'];
            $orderedBy = isset($datas['ordered_by']) ? $datas['ordered_by'] : 'name';
            $order = isset($datas['order']) ? $datas['order'] : 'ASC';
            $withPager = isset($datas['with_pager']) && $datas['with_pager'];
            $page = isset($datas['page']) ? $datas['page'] : 1;
            $max = isset($datas['max']) ? $datas['max'] : 50;
            $strictSearch = isset($datas['strict']) ? $datas['strict'] : false;

            $tags = $this->tagManager->getTags(
                $user,
                $search,
                $withPlatform,
                $orderedBy,
                $order,
                $withPager,
                $page,
                $max,
                $strictSearch
            );
        } else {
            $tags = $this->tagManager->getPlatformTags();
        }

        foreach ($tags as $tag) {
            $tagsName[] = $tag->getName();
        }
        $event->setResponse($tagsName);
    }
301743
public function onGenerateResourceTracking(GenericDataEvent $event)
    {
        $data = $event->getData();
        $node = $data['resourceNode'];
        $user = $data['user'];
        $startDate = $data['startDate'];

        $logs = $this->evaluationManager->getLogsForResourceTracking(
            $node,
            $user,
            ['resource-read', 'resource-icap_wiki-section_create', 'resource-icap_wiki-section_update'],
            $startDate
        );
        $nbLogs = count($logs);

        if ($nbLogs > 0) {
            $this->om->startFlushSuite();
            $tracking = $this->evaluationManager->getResourceUserEvaluation($node, $user);
            $tracking->setDate($logs[0]->getDateLog());
            $status = AbstractResourceEvaluation::STATUS_UNKNOWN;
            $nbAttempts = 0;
            $nbOpenings = 0;

            foreach ($logs as $log) {
                switch ($log->getAction()) {
                    case 'resource-read':
                        ++$nbOpenings;

                        if (AbstractResourceEvaluation::STATUS_UNKNOWN === $status) {
                            $status = AbstractResourceEvaluation::STATUS_OPENED;
                        }
                        break;
                    case 'resource-icap_wiki-section_create':
                    case 'resource-icap_wiki-section_update':
                        ++$nbAttempts;
                        $status = AbstractResourceEvaluation::STATUS_PARTICIPATED;
                        break;
                }
            }
            $tracking->setStatus($status);
            $tracking->setNbAttempts($nbAttempts);
            $tracking->setNbOpenings($nbOpenings);
            $this->om->persist($tracking);
            $this->om->endFlushSuite();
        }
        $event->stopPropagation();
    }
890563
public function forget($event)
    {
        if (Str::contains($event, '*')) {
            unset($this->wildcards[$event]);
        } else {
            unset($this->listeners[$event]);
        }
    }
17971
public function dispatch($eventName, array $context = array())
    {
        return $this->getEventDispatcher()->dispatch(
            $eventName,
            new GenericEvent($this, $context)
        );
    }