@param string $id
@param string $class

@return void
@author Maximilian Ruta <mr@xtain.net>
493742
public function renderMenu($id = 'menu', $class = '')
    {
        $this->addAdditionalMenuItems(self::$menuManager->getMenuItems());

        parent::renderMenu($id, $class);
    }
246052
public function removeUsersAction($id, $class, Request $request)
    {
        $object = $this->find($class, $id);
        $users = $this->decodeIdsString($request, 'Claroline\CoreBundle\Entity\User');
        $this->crud->patch($object, 'user', Crud::COLLECTION_REMOVE, $users);

        return new JsonResponse(
            $this->serializer->serialize($object)
        );
    }
819246
protected function setIds($id)
    {
        if ($id) {
            $this->props = $this->mergeProps(array(
                $this->props,
                array(
                    'attribsContainer' => array(
                        'id' => $id.'_container',
                    ),
                    'attribs' => array(
                        'id' => $id,
                    ),
                    'attribsLabel' => array(
                        'for' => $id,
                    ),
                    'attribsHelpBlock' => array(
                        'id' => $id.'_help_block',
                    ),
                ),
            ));
        }
    }
907206
public function handleDelete(int $id): void
	{
		if ($this->isAjax() && $this->editConst) {
			$content = $this->orm->content->getById($id);
			$this->orm->content->removeAndFlush($content);
			$this['list']->reload();
		} else {
			$this->terminate();
		}
	}
122666
protected function getNodes($class, $id)
    {
        $records = [];
        $records['nodes'] = [];
        $models = $this->getNodeModels($class, $id);
        foreach ($models as $model) {
            $records['nodes'][] = $this->getNodeValues($model);
        }
        return $records;
    }
1005306
public function DeleteCache($objectclass,$id)
	{
		$this->_level1Cache->Delete($objectclass . "_" . $id);
		$this->_level2Cache->Delete($objectclass . "_" . $id);
		$this->Observe("Deleted TYPE='$objectclass' ID='$id' from Cache",OBSERVE_DEBUG);
	}
820514
private function executeDeletions($class)
    {
        $className  = $class->name;
        $persister  = $this->getEntityPersister($className);
        $invoke     = $this->listenersInvoker->getSubscribedSystems($class, Events::postRemove);

        foreach ($this->entityDeletions as $oid => $entity) {
            if ($this->em->getClassMetadata(get_class($entity))->name !== $className) {
                continue;
            }

            $persister->delete($entity);

            unset(
                $this->entityDeletions[$oid],
                $this->entityIdentifiers[$oid],
                $this->originalEntityData[$oid],
                $this->entityStates[$oid]
            );

            // Entity with this $oid after deletion treated as NEW, even if the $oid
            // is obtained by a new entity because the old one went out of scope.
            //$this->entityStates[$oid] = self::STATE_NEW;
            if ( ! $class->isIdentifierNatural()) {
                $class->reflFields[$class->identifier[0]]->setValue($entity, null);
            }

            if ($invoke !== ListenersInvoker::INVOKE_NONE) {
                $this->listenersInvoker->invoke($class, Events::postRemove, $entity, new LifecycleEventArgs($entity, $this->em), $invoke);
            }
        }
    }
629787
public function classname($id)
    {
        # todo -- returns null class instead of null
        return isset($this->classes[$id]) ? $this->classes[$id] : null;
    }
246394
public function set($id, $service)
    {
        if (!$this->has($id)) {
            $this->repository->set($id, $service);
        }
    }
351224
public function find(string $modelClass, string $id = null)
    {
        if (null === $id) {
            return null;
        }

        return $this->getRepositoryByClass($modelClass)->find($id);
    }
1359070
public function addOrganizationsAction($id, $class, Request $request)
    {
        $object = $this->find($class, $id);
        $organizations = $this->decodeIdsString($request, 'Claroline\CoreBundle\Entity\Organization\Organization');
        $this->crud->patch($object, 'organization', Crud::COLLECTION_ADD, $organizations);

        return new JsonResponse(
            $this->serializer->serialize($object)
        );
    }
867740
private function registerApi(string $id, string $class): void
    {
        $api = $this->register($id, $class)
            ->addMethodCall('setHttpClient', [new Reference('http_client_with_token')]);

        if (in_array($id, ['agent', 'menu', 'message'])) {
            $api->addMethodCall('setAgentId', [$this->config->get('agent_id')]);
        }
    }
1313525
public function removeGroupsAction($id, $class, Request $request)
    {
        $object = $this->find($class, $id);
        $groups = $this->decodeIdsString($request, 'Claroline\CoreBundle\Entity\Group');
        $this->crud->patch($object, 'group', Crud::COLLECTION_REMOVE, $groups);

        return new JsonResponse($this->serializer->serialize($object));
    }
502156
public function setId($id = null)
    {
        if ($id !== null) {
            $id = preg_replace("/[^a-z0-9_\\\d]/i", '_', $id);

            $this->id = (string) $id;
        }
    }
318954
public function setClass($class)
    {
        foreach ($this->results as $name) {
            $this->columns->offsetGet($name)->setClass($class);
        }
    }
166710
public function setId($id)
    {
        if ($this->id) {
            return;
        }
        if (strlen($id) >= 20) {
            $this->id = $id;

            return;
        }
        list($a, $b) = explode(' ', microtime());
        $this->id = preg_replace("/[^\d]/", '', $b.$a.$id);
    }
592772
public static function delete_by_id($className, $id)
    {
        $obj = DataObject::get_by_id($className, $id);
        if ($obj) {
            $obj->delete();
        } else {
            user_error("$className object #$id wasn't found when calling DataObject::delete_by_id", E_USER_WARNING);
        }
    }