Removes a block

@param integer $id
@param integer $rootVersion

@return JsonResponse
322658
public function removeBlockAction($id)
    {
        $this->getDoctrine()->getManager()->getFilters()->disable('draftversion');
        /** @var BlockManager $manager */
        $manager  = $this->get('opifer.content.block_manager');
        $response = new JsonResponse;

        try {
            $block = $manager->find($id);
            $manager->remove($block);
            $response->setData(['state' => 'removed']);
        } catch (\Exception $e) {
            $response->setStatusCode(500);
            $response->setData(['error' => $e->getMessage()]);
        }

        return $response;
    }
164053
public function deleteAction($id)
    {
        try {
            return parent::deleteAction($id);
        } catch (\Exception $e) {
            return $this->deleteActionException($e);
        }
    }
181619
public function destroy($id)
    {
        $model = $this->getModelName();

        $nodeType = $model::findOrFail($id);

        $this->builderService->destroyTable(
            $nodeType->getName(),
            $nodeType->getFieldKeys(),
            $nodeType->getKey()
        );

        $nodeType->delete();

        return $nodeType;
    }
1326586
public function remove($idBlock, BlockManagersCollection $blockManagersCollection)
    {
        $blockManagerInfo = $blockManagersCollection->getManagerInfoByBlockId($idBlock);
        $blockManager = $blockManagerInfo['manager'];
        // @codeCoverageIgnoreStart
        if (null === $blockManager) {
            return null;
        }
        // @codeCoverageIgnoreEnd

        try {
            $this->blockRepository->startTransaction();

            // Adjust the blocks position
            $parts = $blockManagersCollection->removeAt($blockManagerInfo["index"]);
            $result = $this->adjustPosition('del', $parts["right"]);
            if (false !== $result) {
                $result = $blockManager->delete();
            }

            if (false !== $result) {
                $this->blockRepository->commit();

                return $result;
            }

            $this->blockRepository->rollBack();

            return $result;
        } catch (\Exception $e) { echo $e->getMessage();
            $this->blockRepository->rollBack();

            throw $e;
        }
    }
558326
public function remove($id)
    {
        $user = User::findOrNew($id);

        $user->delete();

        Alert::info(__('User was removed'));

        return redirect()->route('platform.systems.users');
    }
595151
public static function DeleteParent($id) {
		$getparent = Dep::where('parent', '=', $id)->get();
		foreach ($getparent as $parent) {
			$check = Dep::find($parent->id);

			if ($check->parent > 0) {
				self::DeleteParent($check->id);
				@Up::del_icon($check->icon);
				$check->delete();
			} else {
				@Up::del_icon($check->icon);
				$check->delete();
			}

		}
	}
649654
public function revert(BlockInterface $block, $version)
    {
        $block->accept(new RevertVisitor($this, $version));

        if ($block instanceof BlockContainerInterface) {
            self::treeAddMissingChildren($block);
            self::treeRemoveInvalidChildren($block);
            $block->accept(new SortVisitor());
        }
    }
654296
public function makeBlockShared($id)
    {
        if ($this->em->getFilters()->isEnabled('draftversion')) {
            $this->em->getFilters()->disable('draftversion');
        }

        $block = $this->find($id);
        $version = $this->getNewVersion($block);

        // Duplicate some of the settings to the pointer
        $pointer = new PointerBlock();
        $pointer->setOwner($block->getOwner());
        $pointer->setParent($block->getParent());
        $pointer->setReference($block);
        $pointer->setRootVersion($version);

        // Detach and make shared
        $block->setShared(true);
        $block->setParent(null);
        $block->setOwner(null);
        $block->setPosition(0);
        $block->setSort(0);
        $block->setRootVersion($version);


        $this->killLoggableListener();

        $this->save($block)->save($pointer);

        return $pointer;
    }
427138
public function removeVersion($documentVersion)
    {
        $oid = spl_object_hash($documentVersion);
        $history = $this->documentHistory[$oid];
        $version = $this->documentVersion[$oid];

        $history->removeVersion($version->getName());

        unset($this->documentVersion[$oid], $this->documentHistory[$oid]);
    }
96731
public function remove($id, $filename = null)
    {
        if ($filename == null) {
            return FileManager::rmdir($this->getPath($id));
        } else {
            return FileManager::rmfile($this->getPath($id, $filename));
        }
    }
799304
public function destroyUpdate($id)
    {
        return $this->send($this->getHttp()->post($this->url.'updates/'.$id.'/destroy.json'));
    }
983731
public function deleteRow($id)
    {
        unset($this->rows[$id]);

        if (in_array($id, $this->specialRows['header'])) {
            unset($this->specialRows['header'][array_search($id, $this->specialRows['header'])]);
        }

        if (in_array($id, $this->specialRows['footer'])) {
            unset($this->specialRows['footer'][array_search($id, $this->specialRows['footer'])]);
        }

        if ($this->activeRow == $id) {
            end($this->rows);
            $this->activeRow = key($this->rows);
        }

        return $this;
    }
791049
static function removeById( $attributeId, $version = null )
    {
        if ( $version !== null )
    	   $conds = array( 'contentobject_attribute_id' => $attributeId, 'contentobject_version' => $version  );
    	else
    	    $conds = array( 'contentobject_attribute_id' => $attributeId );

        eZPersistentObject::removeObject( self::definition(), $conds, null );
    }
834461
public static function removeByID( $id )
    {
        $db = eZDB::instance();
        $db->begin();
        $db->query( "DELETE FROM ezcobj_state_link WHERE contentobject_state_id=$id" );
        eZPersistentObject::removeObject( eZContentObjectStateLanguage::definition(), array( 'contentobject_state_id' => $id ) );
        eZPersistentObject::removeObject( eZContentObjectState::definition(), array( 'id' => $id ) );
        $db->commit();
    }
1258667
public function destroy($id)
    {
        // get role by id
        $role = Role::find($id);

        if (!$role) {
            return response()->json(null, 404);
        }

        // delete role
        $deleteRole = $role->delete();

        if (!$deleteRole) {
            return response()->json(null, 500); // @codeCoverageIgnore
        }

        return response()->json(null, 204);
    }
1039674
public function destroy($id)
    {
        // get permission by id
        $permission = Permission::find($id);

        if (!$permission) {
            return response()->json(null, 404);
        }

        // delete permission
        $deletePermission = $permission->delete();

        if (!$deletePermission) {
            return response()->json(null, 500); // @codeCoverageIgnore
        }

        return response()->json(null, 204);
    }
1274003
public function deleteBreakType($id)
    {
        list($response, $statusCode, $httpHeader) = $this->deleteBreakTypeWithHttpInfo ($id);
        return $response; 
    }