Recursively removes aliases by given $id and $action.

$original parameter is used to limit removal of moved Location aliases to history entries only.

@param mixed $id
@param string $action
@param mixed $original
555842
protected function removeSubtree($id, $action, $original)
    {
        // Remove first to avoid unnecessary recursion.
        if ($original) {
            // If entry is original remove all for action (history and custom entries included).
            $this->gateway->remove($action);
        } else {
            // Else entry is history, so remove only for action with the id.
            // This means $id grouped history entries are removed, other history, active autogenerated
            // and custom are left alone.
            $this->gateway->remove($action, $id);
        }

        // Load all autogenerated for parent $id, including history.
        $entries = $this->gateway->loadAutogeneratedEntries($id, true);

        foreach ($entries as $entry) {
            $this->removeSubtree($entry['id'], $entry['action'], $entry['is_original']);
        }
    }
182827
protected function o_toUnicode($id, $action)
    {
        switch ($action) {
            case 'new':
                $this->objects[$id] = array(
                    't'    => 'toUnicode'
                );
                break;
            case 'add':
                break;
            case 'out':
                $ordering = '(UCS)';
                $registry = '(Adobe)';

                if ($this->encrypted) {
                    $this->encryptInit($id);
                    $ordering = $this->ARC4($ordering);
                    $registry = $this->ARC4($registry);
                }

                $stream = <<<EOT
/CIDInit /ProcSet findresource begin
12 dict begin
begincmap
/CIDSystemInfo
<</Registry $registry
/Ordering $ordering
/Supplement 0
>> def
/CMapName /Adobe-Identity-UCS def
/CMapType 2 def
1 begincodespacerange
<0000> <FFFF>
endcodespacerange
1 beginbfrange
<0000> <FFFF> <0000>
endbfrange
endcmap
CMapName currentdict /CMap defineresource pop
end
end
EOT;

                $res = "\n$id 0 obj\n";
                $res .= "<</Length " . mb_strlen($stream, '8bit') . " >>\n";
                $res .= "stream\n" . $stream . "\nendstream" . "\nendobj";;

                return $res;
        }

        return null;
    }
504975
public function moveUpAction($id)
    {
        $repo   = $this->getDoctrine()->getManager()->getRepository($this->admin->getClass());
        $result = $repo->find($id);
        $repo->moveUp($result);

        if ($referer = $this->getRequest()->headers->get('referer')) {
            return $this->redirect($referer);
        } else {
            return new Response('<script>history.go(-1);</script>');
        }
    }
256218
public function delete(string $id)
    {
        $this->setFile($id);
        if (file_exists($this->file)) {
            if ($this->versionamento) {
                $dadosAtuais = $this->get($id);
                $dadosAtuais['userlogin-action'] = "delete";
                unset($dadosAtuais['id']);
                parent::createVerion($this->file, $dadosAtuais);
            }
            unlink($this->file);
        }
    }
372239
public function remove($id)
    {
        if (isset($this->aliases[$id])) {
            $aliasId = $id;
            $id = $this->aliases[$id];
            unset($this->aliases[$aliasId]);
        }

        unset($this->keys[$id]);
        unset($this->values[$id]);
        unset($this->immutable[$id]);
        unset($this->factories[$id]);
        unset($this->definition[$id]);
    }
945213
public function destroyAction($actionId)
    {
        if (isset($this->manialinkByAction[$actionId])) {
            unset($this->actionsByManialink[$this->manialinkByAction[$actionId]->getId()][$actionId]);
            unset($this->actions[$actionId]);
        }
    }
659574
private function removeFromCache($original)
    {
        $cacheKey = $this->getCacheKey($original);
        $cacheContent = $this->cache->fetch($this->getCacheKey($original));
        if (is_array($cacheContent) && isset($cacheContent[$original])) {
            unset($cacheContent[$original]);
            $this->cache->save($cacheKey, $cacheContent);
        }
    }
1242067
public function callAction($action, $defaultAction = 'request') {
		if (method_exists($this, $action)) return $this->{$action}();
		else return $this->{$defaultAction}();
	}
235434
public function handleDelete(int $id): void
	{
		if ($this->isAjax()) {
			$page = $this->orm->pages->getById($id);
			$parent = $page->parent;
			$this->orm->pages->removeAndFlush($page);
			if ($parent !== null) {
				$this['list']->setDataSource($this->orm->pages->findById($parent->id));
				$this['list']->redrawItem($parent->id);
			} else {
				$this['list']->redrawControl();
			}
		} else {
			$this->terminate();
		}
	}
967340
protected function deleteEntityLink($id)
    {
        $post = $this->repository->find($id);

        $this->manager->remove($post);
        $this->manager->flush();
    }
1093365
public function id_translate_after($action) {
		$id = $action->get_id();
		$action->set_id($this->level_id($id));
		$id = $action->get_new_id();
		$action->success($this->level_id($id));
	}
383564
public function remove($action, $id = null)
    {
        try {
            $this->innerGateway->remove($action, $id);
        } catch (DBALException $e) {
            throw new \RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new \RuntimeException('Database error', 0, $e);
        }
    }
1110649
public function deleteAction($id)
    {
        $mailingList = $this->getDoctrine()->getRepository('OpiferMailingListBundle:MailingList')->find($id);

        if (!empty($mailingList)) {
            $em = $this->getDoctrine()->getManager();
            $em->remove($mailingList);
            $em->flush();
        }

        return $this->redirectToRoute('opifer_mailing_list_mailing_list_index');
    }
964507
def action_delete(self, ids):
        """"""
        is_current = any(SessionActivity.is_current(sid_s=id_) for id_ in ids)
        if is_current:
            flash('You could not remove your current session', 'error')
            return
        for id_ in ids:
            delete_session(sid_s=id_)
        db.session.commit()
277297
public function deleteAction($id)
    {
        /** @var Menus_Entity_Table_Menu $table */
        $table = ORM::getTable($this->plugin, 'Menu');
        /** @var Menus_Entity_Menu $menu */
        $menu = $table->find($id);

        if (!is_null($menu))
        {
            $table->delete($menu);
        }
        HTTP::redirect(str_replace('&amp;', '&', $this->ui->url()));
    }
568627
public function deleteAction()
    {
        $model = $this->getModel();
        $model->applyRequest($this->getRequest());

        $model->delete();
        $this->_reroute(array($this->getRequest()->getActionKey() => 'index', MUTil_Model::REQUEST_ID => null));
    }
982575
public function clear($action = null, $resource = null, $resourceId = null)
    {
        $actions = (array) $action;
        $resourceObject = $this->convertResourceToObject($resource, $resourceId);
        $permissions = $this->getPermissions();

        if ($action === null && $resource === null) {
            // Clear every permission for this lock instance.
            foreach ($permissions as $permission) {
                $this->removePermission($permission);
            }
        } elseif ($action === null && $resource !== null) {
            // Clear all permissions for a given resource.
            /** @todo Needs to be implemented */
        } else {
            // Clear every permission for the given actions.
            foreach ($actions as $action) {
                $this->clearPermission($action, $resourceObject, $permissions);
            }
        }
    }