Delete an instance
@return void
15219
public function sasDeleteInstance()
	{
		$clazz = $this->getCurrentClass();
		$instance = $this->getCurrentInstance();

		$this->setData('label', $instance->getLabel());

		$this->setData('uri', tao_helpers_Uri::encode($instance->getUri()));
		$this->setData('classUri', tao_helpers_Uri::encode($clazz->getUri()));
		$this->setView('sas/delete.tpl', 'tao');
	}
14723
public function delete()
    {
        if (count($this) == 0) {
            return;
        }
        $ids = $this->getPrimaryKeyList();
        $hitman = new $this->className();
        $hitman->in($hitman->getPrimaryKey(), $ids)->delete();
    }
1366503
public function delete()
    {
        $this->getContext()->invokeApiPost('DATABASES', [
            'action' => 'delete',
            'select0' => $this->getDatabaseName(),
        ]);
        $this->getContext()->getContextUser()->clearCache();
    }
521594
public function removeInstance(WidgetInstance $instance)
    {
        if ($this->instances->contains($instance)) {
            $this->instances->removeElement($instance);
        }
    }
584797
function delete() {
        $sizes   = array_keys($this->getSizes());
        $sizes[] = null;
        $sizes[] = '_';
        foreach($sizes as $size) {
            $f = $this->makePath($size);
            if($f) {
                \File::delete($f);
            }
        }
    }
365
def delete(self, **params):
        """"""
        d = self.request('delete', self.instance_url(), params)
        return d.addCallback(self.refresh_from).addCallback(lambda _: self)
1286611
public function delete()
    {
        Connection::sendCurlRequest(Connection::URL_DEVICES . '/' . $this->iden, 'DELETE', null, false,
            $this->apiKey);
    }
1320993
public function delete()
    {
        $this->userId = $this->getEntityProvider()->getMe()->getId();
        $this->getLogger()->info('Deleting widget ID ' . $this->widgetId);
        $this->doDelete('/playlist/widget/' . $this->widgetId , $this->toArray());

        return true;
    }
1121724
public function delete() {
        global $DB;
        $DB->delete_records('portfolio_instance_config', array('instance' => $this->get('id')));
        $DB->delete_records('portfolio_instance_user', array('instance' => $this->get('id')));
        $DB->delete_records('portfolio_tempdata', array('instance' => $this->get('id')));
        $DB->delete_records('portfolio_instance', array('id' => $this->get('id')));
        $this->dirty = false;
        return true;
    }
709180
public function delete()
    {
        $active = static::getActive();
        if ($active !== null && $active->getSystemCaptchaLibraryHandle() === $this->sclHandle) {
            if ($scl = static::getByHandle('securimage')) {
                $scl->activate();
            }
        }
        $app = Facade::getFacadeApplication();
        $db = $app->make('database')->connection();
        $db->executeQuery('delete from SystemCaptchaLibraries where sclHandle = ?', [$this->sclHandle]);
    }
941742
public function delete()
    {
        $app = Application::getFacadeApplication();
        $db = $app->make('database')->connection();
        $logID = $this->getID();
        if (!empty($logID)) {
            $db->delete('Logs', ['logID' => $logID]);
        }
    }
1193567
public function Destroy () {
		$name = $this->__name;
		$names = & static::$meta->names;
		$hoops = & static::$meta->hoops;
		$expirations = & static::$meta->expirations;
		$instances = & static::$instances;
		if (isset($names[$name])) unset($names[$name]);
		if (isset($hoops[$name])) unset($hoops[$name]);
		if (isset($expirations[$name])) unset($expirations[$name]);
		if (isset($_SESSION[$name])) unset($_SESSION[$name]);
		if (isset($instances[$name])) unset($instances[$name]);
	}
1131973
public function delete()
    {
        /**
         * Check for many2many attributes and make sure related Entity has a corresponding many2many attribute defined.
         * If not - deleting is not allowed.
         */

        /* @var $attr Many2ManyAttribute */
        $thisClass = get_class($this);
        foreach ($this->getAttributes() as $attrName => $attr) {
            if ($this->isInstanceOf($attr, AttributeType::MANY2MANY)) {
                $foundMatch = false;
                $relatedClass = $attr->getEntity();
                $relatedEntity = new $relatedClass;
                /* @var $relAttr Many2ManyAttribute */
                foreach ($relatedEntity->getAttributes() as $relAttr) {
                    if ($this->isInstanceOf($relAttr, AttributeType::MANY2MANY) && $this->isInstanceOf($this, $relAttr->getEntity())) {
                        $foundMatch = true;
                    }
                }

                if (!$foundMatch) {
                    throw new EntityException(EntityException::NO_MATCHING_MANY2MANY_ATTRIBUTE_FOUND, [
                        $thisClass,
                        $relatedClass,
                        $attrName
                    ]);
                }
            }
        }

        /**
         * First check all one2many records to see if deletion is restricted
         */
        $one2manyDelete = [];
        $many2oneDelete = [];
        $many2manyDelete = [];
        foreach ($this->getAttributes() as $key => $attr) {
            if ($this->isInstanceOf($attr, AttributeType::ONE2MANY)) {
                if ($attr->getOnDelete() == 'ignore') {
                    continue;
                }

                /* @var $attr One2ManyAttribute */
                if ($attr->getOnDelete() == 'restrict' && $this->getAttribute($key)->getValue()->count() > 0) {
                    throw new EntityException(EntityException::ENTITY_DELETION_RESTRICTED, [$key]);
                }
                $one2manyDelete[] = $attr;
            }

            if ($this->isInstanceOf($attr, AttributeType::MANY2ONE)) {
                /* @var $attr Many2OneAttribute */
                if ($attr->getOnDelete() === 'cascade') {
                    $many2oneDelete[] = $attr;
                }
                continue;
            }

            if ($this->isInstanceOf($attr, AttributeType::MANY2MANY)) {
                $many2manyDelete[] = $attr;
            }
        }

        /**
         * Delete one2many records
         */
        foreach ($one2manyDelete as $attr) {
            foreach ($attr->getValue() as $item) {
                $item->delete();
            }
        }

        /**
         * Delete many2many records
         */
        foreach ($many2manyDelete as $attr) {
            $attr->unlinkAll();
        }

        /**
         * Delete many2one records that are set to 'cascade'
         */
        foreach ($many2oneDelete as $attr) {
            $value = $attr->getValue();
            if ($value && $value instanceof AbstractEntity) {
                $value->delete();
            }
        }

        /**
         * Delete $this
         */
        $this->entity()->getDatabase()->delete(static::$collection, ['_id' => $this->entity()->getDatabase()->id($this->id)]);

        static::entity()->remove($this);

        return true;
    }
655239
public function deleteInstances($selfedit = "false", $instancesNames = array(), $returnurl = null) {
        $this->selfedit = $selfedit;

        if ($selfedit == "true") {
            $this->moufManager = MoufManager::getMoufManager();
        } else {
            $this->moufManager = MoufManager::getMoufManagerHiddenInstance();
        }

        if(!empty($instancesNames)) {
            foreach($instancesNames as $instanceName) {
                $this->moufManager->removeComponent($instanceName);
            }
            $this->moufManager->rewriteMouf();
        }

        if ($returnurl) {
            header("Location:".$returnurl);
        } else {
            header("Location: .?selfedit=".$selfedit);
        }
    }
1293721
public function deleteObject()
    {
        $qry = new DeleteEntityQuery($this);
        $this->getContext()->addQuery($qry);
        $this->removeFromParentCollection();
    }
683976
public function delete()
    {
        if ($this->getCacheBusting()) {
            $this->queryCache()->flush($this->getTable());
        }

        return parent::delete();
    }
866842
protected function delete()
    {
        if ($this->executed) {
            return;
        }

        $request = new Request(Request::DELETE);
        $request->setHost($this->app->getHost())
            ->setEndpoint(self::ENDPOINT)
            ->setCredentials($this->app->getAppId(), $this->app->getSecretKey());

        $result = $request->send(
            [
                "reference_id" => $this->referenceId
            ]
        );

        $result->getData();
        $this->executed = true;
    }