This is called for each DELETE request received from the stream and must
be implemented in extending classes.

@param array  $interaction The interaction data structure
@param string $hash        The stream hash.

@return void
544332
protected function onDeleted($interaction, $hash = false)
    {
        $this->_eventHandler->onDeleted($this, $interaction, $hash);
    }
649488
public function remove($object) : void
    {
        $hash = spl_object_hash($object);

        unset($this->objects[$hash]);
        unset($this->data[$hash]);
    }
1099344
public function deleteUserMetadataField($field, $hash, $organization = '')
    {
        return $this->doUserMetadataRequest([$field => null], $hash, 'PATCH', $organization);
    }
2805
protected function interact(InputInterface $input, OutputInterface $output)
    {
        if (!$input->getArgument('pool')) {
            $pool = (new InteractHelper())->askForPool($this, $input, $output);
            $input->setArgument('pool', $pool);
        }
    }
60132
protected function deleteMultiple(array $environments, InputInterface $input, OutputInterface $output)
    {
        // Confirm which environments the user wishes to be deleted.
        $delete = [];
        $deactivate = [];
        $error = false;
        /** @var \Platformsh\Cli\Service\QuestionHelper $questionHelper */
        $questionHelper = $this->getService('question_helper');
        foreach ($environments as $environment) {
            $environmentId = $environment->id;
            if ($environmentId == 'master') {
                $output->writeln("The <error>master</error> environment cannot be deleted.");
                $error = true;
                continue;
            }
            // Check that the environment does not have children.
            // @todo remove this check when Platform's behavior is fixed
            foreach ($this->api()->getEnvironments($this->getSelectedProject()) as $potentialChild) {
                if ($potentialChild->parent == $environment->id) {
                    $output->writeln(
                        "The environment <error>$environmentId</error> has children and therefore can't be deleted."
                    );
                    $output->writeln("Please delete the environment's children first.");
                    $error = true;
                    continue 2;
                }
            }
            if ($environment->isActive()) {
                $output->writeln("The environment <comment>$environmentId</comment> is currently active: deleting it will delete all associated data.");
                if ($questionHelper->confirm("Are you sure you want to delete the environment <comment>$environmentId</comment>?")) {
                    $deactivate[$environmentId] = $environment;
                    if (!$input->getOption('no-delete-branch')
                        && $this->shouldWait($input)
                        && ($input->getOption('delete-branch')
                            || (
                                $input->isInteractive()
                                && $questionHelper->confirm("Delete the remote Git branch too?")
                            )
                        )) {
                        $delete[$environmentId] = $environment;
                    }
                }
            } elseif ($environment->status === 'inactive') {
                if ($questionHelper->confirm("Are you sure you want to delete the remote Git branch <comment>$environmentId</comment>?")) {
                    $delete[$environmentId] = $environment;
                }
            } elseif ($environment->status === 'dirty') {
                $output->writeln("The environment <error>$environmentId</error> is currently building, and therefore can't be deleted. Please wait.");
                $error = true;
                continue;
            }
        }

        $deactivateActivities = [];
        $deactivated = 0;
        /** @var Environment $environment */
        foreach ($deactivate as $environmentId => $environment) {
            try {
                $output->writeln("Deleting environment <info>$environmentId</info>");
                $deactivateActivities[] = $environment->deactivate();
                $deactivated++;
            } catch (\Exception $e) {
                $output->writeln($e->getMessage());
            }
        }

        if ($this->shouldWait($input)) {
            /** @var \Platformsh\Cli\Service\ActivityMonitor $activityMonitor */
            $activityMonitor = $this->getService('activity_monitor');
            if (!$activityMonitor->waitMultiple($deactivateActivities, $this->getSelectedProject())) {
                $error = true;
            }
        }

        $deleted = 0;
        foreach ($delete as $environmentId => $environment) {
            try {
                if ($environment->status !== 'inactive') {
                    $environment->refresh();
                    if ($environment->status !== 'inactive') {
                        $output->writeln("Cannot delete branch <error>$environmentId</error>: it is not (yet) inactive.");
                        continue;
                    }
                }
                $environment->delete();
                $output->writeln("Deleted remote Git branch <info>$environmentId</info>");
                $deleted++;
            } catch (\Exception $e) {
                $output->writeln($e->getMessage());
            }
        }

        if ($deleted > 0) {
            $output->writeln("Run <info>git fetch --prune</info> to remove deleted branches from your local cache.");
        }

        if ($deleted < count($delete) || $deactivated < count($deactivate)) {
            $error = true;
        }

        if (($deleted || $deactivated || $error) && isset($environment)) {
            $this->api()->clearEnvironmentsCache($environment->project);
        }

        return !$error;
    }
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();
		}
	}
88612
public function delete($id)
    {
        if ($this->_mails && isset($this->_mails[$id])) {
            $this->_mails[$id]['is_deleted'] = true;
        }
    }
745143
public function delete($key)
    {
        if (strpos($key, '*') !== false) {
            $this->deleteGlob($key);
        } else {
            $this->client->del([$key]);
        }
    }
816056
public function removeCssFile($hash)
    {
        $file = $this->getViewCssFileFromHash($hash);
        if (file_exists($file)) {
            unlink($file);
        }
    }
964187
protected function markSuccess($hash, $variant = null)
    {
        $key = $this->getErrorCacheKey($hash, $variant);
        $this->getCache()->deleteMultiple([
            $key.'_reason',
            $key.'_ttl'
        ]);
    }
807403
public function execute(InteractorRequestInterface $request)
    {
        $interactor = $this->getInteractorObject($request);
        $interactor->execute($request);
    }
1088468
public function update($id = false, $hash = false, $name = false)
    {

        if ($id) {
            $this->_id = $id;
        }
        if ($hash) {
            $this->_hash = $hash;
        }
        if ($name) {
            $this->_name = $name;
        }

        $params = array(
            'id' => $this->_id,
            'hash' => $this->_hash,
            'name' => $this->_name
        );

        $this->_user->put('pylon/update', $params);
    }
2534
public function removeEventListener($events, $listener): void
	{
		if (!is_object($listener)) {
			$hash = 'service@' . $listener;
		} else {
			// Picks the hash code related to that listener
			$hash = spl_object_hash($listener);
		}
		foreach ((array) $events as $event) {
			// Check if actually have this listener associated
			if (isset($this->listeners[$event][$hash])) {
				unset($this->listeners[$event][$hash]);
			}
		}
	}
652449
public function deleteRecord($index)
    {
        if (isset($this->records[$index])) {
            $this->fileLength -= ($this->records[$index]->getContentLength() + 4);
            $count = count($this->records) - 1;
            for ($i = $index; $i < $count; ++$i) {
                $this->records[$i] = $this->records[$i + 1];
            }
            unset($this->records[count($this->records) - 1]);
            $this->_deleteRecordFromDBF($index);
        }
    }
1126360
public function deleteDoc($id)
    {
        $this->config['client']->delete(
            [
                'id' => $id,
                'index' => $this->getIndex()->getName(),
                'type' => $this->getType()
            ]
        );
    }
177297
def delete(type, hash)
      raise Dis::Errors::ReadOnlyError if readonly?
      delete!(type, hash)
    end
742363
public function deleteRow(int $id) : void
    {
        $this->crudEnabled();

        // Generate the values
        $table_name = static::$table_name;
        $id_column = static::$id_column;

        $sql = "DELETE FROM {$table_name} WHERE {$id_column} = :key";
        $this->dbc->query($sql, ['params' => [':key' => $id]]);
    }