Whether the platform in use requires ON DELETE SETNULL emulation and whether there are references to this table.
@return boolean
541546
protected function isDeleteSetNullEmulationNeeded()
    {
        $table = $this->getTable();
        if ((!$this->getPlatform()->supportsNativeDeleteTrigger() || $this->getBuildProperty('generator.objectModel.emulateForeignKeyConstraints')) && count($table->getReferrers()) > 0) {
            foreach ($table->getReferrers() as $fk) {
                if (ForeignKey::SETNULL === $fk->getOnDelete()) {
                    return true;
                }
            }
        }

        return false;
    }
934115
protected function performDeleteOnModel()
    {
        if ($this->forceDeleting) {
            $this->exists = false;

            return $this->setKeysForSaveQuery($this->newModelQuery())->forceDelete();
        }

        return $this->runSoftDelete();
    }
569072
public function delete()
    {
        if ($this->getPk() === null) {
            return false;
        }
        $query = $this->_queryClass;
        $bindKey = PdoBindHelper::generateBindKey();
        $result = DbConnector::getAdapter()->delete((new $query)->getTableName(), $this->_pkWhere($bindKey), [$bindKey => $this->getInitialStateValue('id')]);
        return ($result > 0) ? true : false;
    }
819153
public function allowsNull()
    {
        if (!empty($this->node->type)) {
            // with type hint, checks if NULL constant provided
            if ($this->node->default instanceof Node\Expr\ConstFetch
                && $this->node->default->name instanceof Node\Name
                && strcasecmp('null', (string)$this->node->default->name) === 0
            ) {
                return true;
            }
            return false;
        }
        return true;
    }
1337706
public function isPostgres()
    {
        static $r;
        if (is_null($r)) {
            $r = $this->driver->getPlatformName() == self::POSTGRESQL_PLATFORM;
        }
        return $r;
    }
870666
protected function hasSystemCallBeenInterrupted()
    {
        $lastError = $this->lastError;
        $this->lastError = null;

        // stream_select returns false when the `select` system call is interrupted by an incoming signal
        return null !== $lastError && false !== stripos($lastError, 'interrupted system call');
    }
714864
private function isOrphanRemovalEnabled()
    {
        if ($this->mapping === null) {
            return false;
        }

        if (isset($this->mapping['embedded'])) {
            return true;
        }

        if (isset($this->mapping['reference']) && $this->mapping['isOwningSide'] && $this->mapping['orphanRemoval']) {
            return true;
        }

        return false;
    }
710121
public function unlockTable()
    {
        $query = 'UNLOCK TABLES';

        // Create commandchain context.
        $context = $this->getCommandContext();
        $context->table = $base;
        $context->query = $query;

        if ($this->getCommandChain()->run('before.unlocktable', $context) !== false) {
            $context->result = $this->execute($context->query, AnDatabase::RESULT_USE);
            $this->getCommandChain()->run('after.unlocktable', $context);
        }

        return $context->result;
    }
905733
public function delete(): bool
    {
        $this->invokeHook("delete");

        if ($this->softDelete) {
            $val = $this->delValType === self::SDEL_VAL_TIMESTAMP
                ? ["func" => "NOW()"]
                : true;
            $status = $this->update([$this->delCol => $val]);
        } else {
            $query = $this->qBuilder->table($this->table)->delete();
            if (($status = $this->db->execute($query)) === false) {
                $this->error = $this->db->lastError();
            }
            $this->qBuilder->reset();
        }

        $this->invokeHook("delete", self::HOOK_AFTER);
        return $status;
    }
511876
public function truncateTable()
    {
        $connection = $this->_em->getConnection();
        $dbPlatform = $connection->getDatabasePlatform();
        $connection->beginTransaction();
        try {
            $q = $dbPlatform->getTruncateTableSql($this->getSearchIndexTable());
            $connection->executeUpdate($q);
            $connection->commit();

            return true;
        } catch (\Exception $e) {
            $connection->rollback();

            return false;
        }
    }
295644
public function has_table()
    {
        if (null === $this->table) {
            $this->set_error('This model is has no table specified', true);
        } elseif (false === $this->table) {
            return false;
        }
    }
674081
public function deleteStrategy()
    {
        if (null === $this->delete_strategy || false === $this->delete_strategy) {
            return false;
        }

        return $this->delete_strategy;
    }
768687
protected function validateDbTypeInstall()
    {
        $field = 'database.type';

        if ($this->isExcluded($field)) {
            return null;
        }

        $value = $this->getSubmitted($field);

        if (empty($value)) {
            $this->setErrorRequired($field, $this->translation->text('Database type'));
            return false;
        }

        $drivers = \PDO::getAvailableDrivers();

        if (in_array($value, $drivers)) {
            return true;
        }

        $error = $this->translation->text('Unsupported database driver. Available drivers: @list', array(
            '@list' => implode(',', $drivers)));

        $this->setError($field, $error);
        return false;
    }
528806
public function delete() {
		
		if(null === $this -> getAdapter()) {
			return trigger_error('Adapter is not set. Set the adapter with the setAdapter() method', E_USER_ERROR);
		}

		//Execute user defined before deleting function
		$this -> beforeDelete();

		$class  	 = new \ReflectionClass(get_class($this));
		$identifiers = $this -> getIdentifier();	
		$values  	 = $this -> toArray();
		$ids 		 = [];
		$escape 	 = [];
		
		if(0 === count($identifiers)) {
			return trigger_error(sprintf('Identifier is NULL. Can not delete entity without a valid value as identifier in %s', $class -> getFileName()), E_USER_ERROR);
		}

		foreach($identifiers as $identifier) {
			
			$ids[] = sprintf('%s = ?', $this -> getAdapter() -> escape($identifier));

			if(true === isset($values[$identifier])) {
				$escape[] = $values[$identifier];
			}
			else {
				$escape[] = null;
			}
		}

		$query = sprintf('DELETE FROM %s WHERE %s LIMIT 1', $this -> getAdapter() -> escape($this -> getTable()), implode($ids, ' AND '));

		$this -> getAdapter() -> query($query, $escape);

		$success = $this -> getAdapter() -> execute();

		//Execute user defined after deleting function
		$this -> afterDelete();

		return $success;
	}
90802
protected function isSigchildEnabled()
    {
        if (null !== self::$sigchild) {
            return self::$sigchild;
        }

        if (!function_exists('phpinfo') || defined('HHVM_VERSION')) {
            return self::$sigchild = false;
        }

        ob_start();
        phpinfo(INFO_GENERAL);

        return self::$sigchild = false !== strpos(ob_get_clean(), '--enable-sigchild');
    }
467274
private function usesSoftDeletes()
    {
        return (
            (isset($this->forceDeleting) && ! $this->forceDeleting) ||
            (isset($this->softDelete) && ! $this->softDelete)
        );
    }
1350383
public function deactivate()
    {
        if (!$this->sieve) {
            return $this->_set_error(self::ERROR_INTERNAL);
        }

        $result = $this->sieve->setActive('');

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

        $this->active = null;

        return true;
    }