Remove single element

@param \Psr\Http\Message\ServerRequestInterface $p_request
334565
public function removeOne(\Psr\Http\Message\ServerRequestInterface $p_request)
    {
        $this->logger->debug('FreeFW.ApiController.removeOne.start');
        $apiParams = $p_request->getAttribute('api_params', false);
        //
        if ($apiParams->hasData()) {
            /**
             * @var \FreeFW\Core\StorageModel $data
             */
            $data = $apiParams->getData();
            $data->remove();
            $this->logger->debug('FreeFW.ApiController.removeOne.end');
            return $this->createResponse(204);
        } else {
            return $this->createResponse(409);
        }
    }
1290431
public function deleteAjaxAction( Request $request ) {
		$id          = $request->get( 'id' );
		$pageId      = $request->get( 'pageId' );
		$uniqId      = $request->get( 'uniqId' );
		$code        = $request->get( 'code' );
		$formFieldId = $request->get( 'formFieldId' );

		if ( $id ) {
			$layoutBlock = $this->admin->getObject( $id );
			if ( $layoutBlock ) {
				$this->admin->delete( $layoutBlock );
			}
		}
		$html = $this->getLayoutBlockFormWidget( $pageId, $formFieldId, $uniqId, $code );

		return new JsonResponse( [
			'messageStatus' => 'success',
			'message'       => $this->translate( 'message.layout_block_deleted' ),
			'html'          => $html,
		] );
	}
272183
public static function remove_domains( array $p_domains ) {
		DisposableEmailChecker::_load_domains();

		foreach( $p_domains as $t_domain ) {
			$t_domain = strtolower( $t_domain );
			unset( DisposableEmailChecker::$domains_array[$t_domain] );
		}
	}
857471
public void removeElement(
        org.opencms.ade.containerpage.client.ui.CmsContainerPageElementPanel dragElement,
        ElementRemoveMode removeMode) {

        if (isGroupcontainerEditing()) {
            dragElement.removeFromParent();
            if (!getGroupcontainer().iterator().hasNext()) {
                // group-container is empty, mark it
                getGroupcontainer().addStyleName(I_CmsLayoutBundle.INSTANCE.containerpageCss().emptyGroupContainer());
            }
            getGroupcontainer().refreshHighlighting();
        } else {
            final String id = dragElement.getId();
            if (id != null) {
                addToRecentList(id, null);
            }

            I_CmsDropContainer container = dragElement.getParentTarget();
            switch (removeMode) {
                case saveAndCheckReferences:
                    dragElement.removeFromParent();
                    if (container instanceof CmsContainerPageContainer) {
                        ((CmsContainerPageContainer)container).checkEmptyContainers();
                    }
                    cleanUpContainers();
                    Runnable checkReferencesAction = new Runnable() {

                        public void run() {

                            checkReferencesToRemovedElement(id);
                        }
                    };
                    setPageChanged(checkReferencesAction);
                    break;
                case confirmRemove:
                    handleConfirmRemove(dragElement);
                    break;
                case silent:
                default:
                    dragElement.removeFromParent();
                    if (container instanceof CmsContainerPageContainer) {
                        ((CmsContainerPageContainer)container).checkEmptyContainers();
                    }
                    cleanUpContainers();
                    setPageChanged();
                    break;
            }
        }
    }
1166500
public function removeSlave(Server $slave)
    {
        $slaveHashId = spl_object_hash($slave);

        if (isset($this->servers['slaves'][$slaveHashId])) {
            unset($this->servers['slaves'][$slaveHashId]);
        }
    }
39620
public boolean remove(final ServerPresentationModel pm) {
        boolean deleted = super.remove(pm);
        if (!deleted) {
            throw new IllegalStateException("Model " + pm + " not found on the server!");
        }
        deleteCommand(getCurrentResponse(), pm.getId());
        return deleted;
    }
167808
def remove_p(self):
        
        try:
            self.unlink()
        except OSError:
            _, e, _ = sys.exc_info()
            if e.errno != errno.ENOENT:
                raise
        return self
404848
public function removeAction(Request $request)
    {
        $row = $this->findRowByRequest($request);
        $container = $row->getContainer();

        try {
            $this->getEditor()->getRowManager()->delete($row);
        } catch (EditorExceptionInterface $e) {
            return $this->handleException($e);
        }

        // Stores id for front removal
        $removedId = $this->getViewBuilder()->buildRow($row)->getAttributes()->getId();

        $this->validate($container);
        $this->persist($container);

        $data = [
            'removed' => [$removedId],
            //'containers' => [$this->getViewBuilder()->buildContainer($container)],
        ];

        return $this->buildResponse($data, self::SERIALIZE_LAYOUT);
    }
1099253
public function deleteElement()
    {
        // Get dependencies
        $PageElement = ($this->container->dataMapper)('PageElementMapper');

        // Check that we received an ID
        if ($this->request->getParsedBodyParam('id')) {
            // Delete block element
            $blockElement = $PageElement->make();
            $blockElement->id = $this->request->getParsedBodyParam('id');
            $PageElement->delete($blockElement);

            $status = 'success';
        } else {
            $status = 'error';
        }

        // Set the response type
        $r = $this->response->withHeader('Content-Type', 'application/json');

        return $r->write(json_encode(['status' => $status]));
    }
511194
private static function removeResourceFromRequestContext(IPoolResource $resource)
    {
        $poolResources = RequestContext::get('poolResources', []);
        $instance = $resource->getInstance();
        $key = spl_object_hash($instance);
        if(isset($poolResources[$key]))
        {
            unset($poolResources[$key]);
            RequestContext::set('poolResources', $poolResources);
        }

        $name = 'poolResource.' . $resource->getPool()->getName();
        $poolResource = RequestContext::get($name);
        if($poolResource === $resource)
        {
            RequestContext::set($name, null);
        }
    }
479054
public function destroy(Request $request, $page)
    {
        // Set roles that have access
        $request->user()->authorizeRoles(['admin', 'editor']);

        $page = Page::withTrashed()->findOrFail($page);

        if ($page->trashed() && !$request->input('confirm_delete')) {
            return redirect()->route('admin.pages.page.delete', $page);
        }

        if ($request->input('confirm_delete')) {
            $page->forceDelete();
            return redirect()->route('admin.pages.index.trashed');
        }

        $page->status = 1;
        $page->save();
        $page->delete();

        flash('Page has been moved to trash')->success();

        return back();
    }
815669
public function removeElementByName($name, $index = null) {

		if($index !== null) {
			unset($this->elements[$name][$index]);
		}
		else {
			unset($this->elements[$name]);
		}

	}
926533
private function cleanHostName(ServerRequestInterface $request)
    {

        if (is_null($this->baseHost)) {
            $hostname = $request->getUri()->getHost();
        } else {
            $hostname = str_replace($this->baseHost, "", $request->getUri()->getHost());
        }

        if (substr($hostname, -1) == ".") {
            $hostname = substr($hostname, 0, -1);
        }

        return $hostname;
    }
367913
public void remove(final String[] pl, final boolean fwd) {
	synchronized (this) {
	    for (final String element : pl) {
		remove_i(element, fwd);
	    }
	}
    }
893997
public static function toCake(PsrRequest $request)
    {
        $post = $request->getParsedBody();
        $headers = [];
        foreach ($request->getHeaders() as $k => $value) {
            $name = sprintf('HTTP_%s', strtoupper(str_replace('-', '_', $k)));
            $headers[$name] = implode(',', $value);
        }
        $server = $headers + $request->getServerParams();

        $files = static::getFiles($request);
        if (!empty($files)) {
            $post = Hash::merge($post, $files);
        }

        $input = $request->getBody()->getContents();
        $input = $input === '' ? null : $input;

        return new ServerRequest([
            'query' => $request->getQueryParams(),
            'post' => $post,
            'cookies' => $request->getCookieParams(),
            'environment' => $server,
            'params' => static::getParams($request),
            'url' => $request->getUri()->getPath(),
            'base' => $request->getAttribute('base', ''),
            'webroot' => $request->getAttribute('webroot', '/'),
            'session' => $request->getAttribute('session', null),
            'input' => $input,
        ]);
    }
179048
public function delete($request, $match)
    {
        // تعیین داده‌ها
        $content = Pluf_Shortcuts_GetObjectOr404('CMS_Content', $match['modelId']);
        // بررسی دسترسی‌ها
        if (! CMS_Precondition::isAuthor($request)) {
            throw new Pluf_Exception_PermissionDenied('You are not an author');
        }
        if (! CMS_Precondition::isEditor($request) && $request->user->id !== $content->author_id) {
            throw new Pluf_Exception_PermissionDenied('You can not delete content created by another author');
        }
        return parent::deleteObject($request, $match, array(
            'model' => 'CMS_Content'
        ));
    }
740097
public function remove($element)
    {
        $currentValue = $this->getRawValue();

        if (($key = array_search($element, $currentValue)) !== false) {
            unset($currentValue[$key]);
            $this->setRawValue($currentValue);
        }
    }