@param string $name
@param bool   $cascadeDelete

@return Closure

@SuppressWarnings(PHPMD.BooleanArgumentFlag)
480130
protected function relationship(string $name, bool $cascadeDelete = false): Closure
    {
        return $this->relationshipImpl($name, true, $cascadeDelete);
    }
574571
public function deleteQueue($name)
    {
        if (!isset($this->queues)) {
            throw new InvalidKeyException(['delete `:queue` queue failed: it is not exists', 'queue' => $name]);
        }

        try {
            $this->_queues[$name]->delete();
        } catch (\Exception $e) {
            throw new AmqpException(['delete `:queue` queue failed: error', 'queue' => $name, 'error' => $e->getMessage()]);
        }

        unset($this->_queues[$name]);

        return $this;
    }
595290
public function purge($cascade = null, $use_transaction = false)
	{

		$this->_disable_soft_delete = true;
		$result = parent::delete($cascade, $use_transaction);
		$this->_disable_soft_delete = false;

		return $result;
	}
1192654
public function delete($name) {

        if ( array_key_exists($name, $this->data) ) {
            unset($this->data[$name]);
            return true;
        }

        return false;

    }
1020892
protected function foreignRelationship(
        string $column,
        string $referredClass,
        bool $cascadeDelete = false
    ): Closure {
        return function (
            Table $table,
            MigrationContextInterface $context
        ) use (
            $column,
            $referredClass,
            $cascadeDelete
        ) {
            $tableName    = $this->getTableNameForClass($referredClass);
            $pkName       = $this->getModelSchemas()->getPrimaryKey($referredClass);
            $columnType   = $this->getModelSchemas()->getAttributeType($context->getModelClass(), $column);
            $columnLength = $columnType === Type::STRING ?
                $this->getModelSchemas()->getAttributeLength($context->getModelClass(), $column) : null;

            $closure = $this->foreignColumn($column, $tableName, $pkName, $columnType, $columnLength, $cascadeDelete);

            return $closure($table, $context);
        };
    }
639671
public function delete( string $name ): Prop
	{
		$prop = new Prop([
			"action" => "delete",
			"deleted" => false
		]);

		// check old
		$row = self::getEventItem($name);
		if( !$row )
		{
			return $prop;
		}

		$this->permissible($row->module_id, $name);

		// dispatch event
		$event = new EventDeleteDriverEvent($this, $name);
		$dispatcher = EventManager::dispatcher($event->getName());
		$dispatcher->dispatch($event);

		$prop->set(
			"deleted",
			\DB::
				table("events")
					->whereId($row->id)
					->delete() > 0
		);

		$prop->get("deleted") && $this->addLogDebug(Text::createInstance("The %s event is successfully removed", $name));
		$dispatcher->complete($prop);
		return $prop;
	}
914301
public function groupDelete($name)
    {
        $request = new DeleteFriendGroupRequest($this->identifier, $name);
        $response = new BaseResponse();
        return $this->client->sendRequest($request, $response);
    }
179071
public function remove($name = null)
    {
        if (!$this->sieve) {
            return $this->_set_error(self::ERROR_INTERNAL);
        }

        if (!$name) {
            $name = $this->current;
        }

        // script must be deactivated first
        if ($name == $this->sieve->getActive()) {
            $result = $this->sieve->setActive('');

            if (is_a($result, 'PEAR_Error')) {
                return $this->_set_error(self::ERROR_DELETE);
            }

            $this->active = null;
        }

        $result = $this->sieve->removeScript($name);

        if (is_a($result, 'PEAR_Error')) {
            return $this->_set_error(self::ERROR_DELETE);
        }

        if ($name == $this->current) {
            $this->current = null;
        }

        $this->list = null;

        return true;
    }
893663
protected function _closure($data, $name)
    {
        $isExpanded = $this->_isExpandedLevel();

        ?>
        <li class="jbchild">
            <div
                class="jbelement<?php echo count((array)$data) > 0 ? ' jbexpand' : ''; ?> <?= $isExpanded ? 'jbopened' : ''; ?>"
                <?php if (count((array)$data) > 0) { ?> onClick="jbdump.toggle(this);"<?php } ?>>
                <span class="jbname"><?php echo $name; ?></span> (<span class="jbtype jbtype-closure">Closure</span>)
                <span class="jbvalue"><?php echo get_class($data); ?></span>
            </div>
            <?php $this->_vars($this->_getFunction($data), $isExpanded); ?>
        </li>
    <?php
    }
1176536
public function dec(string $name, int $step = 1)
    {
        $this->writeTimes++;

        $key = $this->getCacheKey($name);

        return $this->handler->decrby($key, $step);
    }
114671
public function statementDeallocate(string $name): Promise
    {
        if (!$this->handle) {
            return new Success; // Connection dead.
        }

        \assert(isset($this->statements[$name]), "Named statement not found when deallocating");

        $storage = $this->statements[$name];

        if (--$storage->refCount) {
            return new Success;
        }

        unset($this->statements[$name]);

        \assert($storage->statement instanceof pq\Statement, "Statement storage in invalid state");

        return new Coroutine($this->send([$storage->statement, "deallocateAsync"]));
    }
1201163
protected function datetime(string $name): Closure
    {
        return function (Table $table) use ($name) {
            $table->addColumn($name, Type::DATETIME)->setNotnull(true);
        };
    }
1166282
public static function deleteInstance($name)
  {
    $adapter = self::getDataAdapter();
    if (!is_null($adapter)) {
      $key = self::_instanceKey($name);
      
      $result = $adapter->delete($key);
    } else {
      $result = false;
    }
    self::clearInstance($name);
    
    return $result;
  }
1352930
public function dec(string $name, int $step = 1)
    {
        $this->writeTimes++;

        $key   = $this->getCacheKey($name);
        $value = $this->handler->get($key) - $step;
        $res   = $this->handler->set($key, $value);

        return !$res ? false : $value;
    }
788173
public function delete($name)
	{
		$model = sprintf('\\%sAdmin', Str::studly($name));
		$model = (new $model)->buildForm();

		return View::make('krafthaus/bauhaus::models.modals.delete')
			->with('name',  $name)
			->with('model', $model);
	}
142497
protected function text(string $name): Closure
    {
        return function (Table $table) use ($name) {
            $table->addColumn($name, Type::TEXT)->setNotnull(true);
        };
    }
845273
public static function cascadeRemove(&$source, $key)
    {
        if (!$key || !is_string($key)) {
            return false;
        }

        $key = static::cascadeExplode($key);
        $element = &$source;
        while (($d = array_shift($key)) !== null) {
            if (isset($element[$d])) {
                if (count($key)) {
                    $element = &$element[$d];
                    continue;
                } else {
                    unset($element[$d]);

                    return true;
                }
            } else {
                return true;
            }
        }

        return true;
    }