Before delete all constrained foreign relations

@param bool $forced
@return bool
978295
public function beforeDelete( $forced = false )
  {
    try {
      \DB::table(Config::get('workflow::node_user_table'))->where('node_id', $this->id)->delete();
      \DB::table(Config::get('workflow::node_role_table'))->where('node_id', $this->id)->delete();
    } catch(Execption $e) {}

    return true;
  }
602599
protected function touch($force = false)
    {
        if (true === $this->getState()->is('deleted')) {
            return $this;
        }
        if (true === $this->getState()->is('empty') || true === $force) {
            $record = $this->store->retrieveRecord($this->getType(), $this->getId());
            $this->initialize($record['properties']);
            $this->getState()->setLoaded();
        }
        return $this;
    }
59594
protected function perform_delete( $force ) {
		switch ( $this->wp_type ) {
			case 'term':
				$delete = wp_delete_term( $this->get_id(), $this->object_type );
				return ( ! is_wp_error( $delete ) && true === $delete );

			case 'post':
				if ( ! $force && 'trash' !== get_post_status( $this->get_id() ) && EMPTY_TRASH_DAYS ) {
					$delete = wp_trash_post( $this->get_id() );
				} else {
					$delete = wp_delete_post( $this->get_id(), true );
				}

				return ( ! is_null( $delete ) && ! is_wp_error( $delete ) && false !== $delete );
		}

		return false;
	}
783555
private function _removeDisabledRelations()
    {
        if (!$this->attrActive) {
            return false;
        }

        foreach ($this->_relationsToSave as $key => $rel) {

            if (!isset($rel->{$this->attrActive})) {
                continue;
            }

            if (!$rel->validate() && !$rel->{$this->attrActive}) {
                ArrayHelper::remove($this->_relationsToSave, $key);
            }
        }

        return true;
    }
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;
    }
1227646
protected function remove($path, $force = false) {
		$stat = $this->stat($path);
		$stat['realpath'] = $path;
		if (!empty($stat['tmb']) && $stat['tmb'] != "1") {
			$this->rmTmb($stat['tmb']);
		}
		$this->clearcache();
		
		if (empty($stat)) {
			return $this->setError(elFinder::ERROR_RM, $this->_path($path), elFinder::ERROR_FILE_NOT_FOUND);
		}
		
		if (!$force && !empty($stat['locked'])) {
			return $this->setError(elFinder::ERROR_LOCKED, $this->_path($path));
		}
		
		if ($stat['mime'] == 'directory') {
			foreach ($this->_scandir($path) as $p) {
				$name = $this->_basename($p);
				if ($name != '.' && $name != '..' && !$this->remove($p)) {
					return false;
				}
			}
			if (!$this->_rmdir($path)) {
				return $this->setError(elFinder::ERROR_RM, $this->_path($path));
			}
			
		} else {
			if (!$this->_unlink($path)) {
				return $this->setError(elFinder::ERROR_RM, $this->_path($path));
			}
		}

		$this->removed[] = $stat;
		return true;
	}
52139
def force_delete(self):
        
        self.__force_deleting__ = True

        self.delete()

        self.__force_deleting__ = False
402353
protected function performDeleteOnModel()
    {
        if ($this->forceDeleting) {
            return $this->newQueryWithoutScopes()->where($this->getKeyName(), $this->getKey())->forceDelete();
        }

        return $this->runSoftDelete();
    }
1301068
public function save($force=false)
    {
        if (!self::$_loaded) {
            self::_loadColumns();
        }

        // check for callbacks before validation below
        $calling = get_called_class();
        if (!self::_checkCallback($calling, "before_save", $this)) {
            return false;
        }

        // with all the before callbacks checked, check if its valid
        if (!$this->isValid()) {
            return false;
        }

        $pk         = $calling::isIgnoringCase() ? strtolower($calling::getPK()) : $calling::getPK();
        $pk_value   = array_key_exists($pk, $this->_data) ? $this->_data[$pk] : null;
        $attrs      = $this->_data;

        if (!$pk_value) {
            // if there is a method to get the new primary key value on the class, 
            // call it
            if (method_exists($calling, "getNewPKValue")) {
                $pk_value = $calling::getNewPKValue();
                if (!$this->_data[$pk]) {
                    $this->_data[$pk] = $pk_value;
                }
                $attrs = $this->_data;
            }
        }

        // if found a primary key value, check if exists
        if ($pk_value) {
            $this->_new_rec = !self::find($pk_value);
        }

        $rst    = false;
        $newr   = false;

        if ($this->_new_rec) {
            $newr = true;
            self::_checkCallback($calling, "before_create", $this);
            $rst = $this->_insert($attrs, $calling, $pk, $pk_value);
        } else {
            self::_checkCallback($calling, "before_update", $this);

            // no need to update if there weren't changes
            if (sizeof($this->changed()) < 1 && !$force) {
                Log::log("No changes, not updating");
                $rst = true;
            } else {
                $rst = $this->_update($attrs, $calling, $pk, $pk_value);
            }
        }

        if ($rst) {
            self::_checkCallback($calling, "after_save", $this);
            if ($newr) {
                self::_checkCallback($calling, "after_create", $this);
            } else {
                self::_checkCallback($calling, "after_update", $this);
            }
        }
        $this->_prev_data = $this->_data;
        return $rst;
    }
839581
public function remove(string $name, bool $force = false)
    {
        return $this->curl->delete($this->base_url.'/'.$name.'?'.http_build_query([
                    'force' => $force,
                ]
            )
        );
    }
407266
public function forceUseMaster($forceUseMaster = true)
    {
        foreach ($this->queries as $query) {
            $query->forceUseMaster($forceUseMaster);
        }

        return $this;
    }
1116397
protected function isDeleteCascadeEmulationNeeded()
    {
        $table = $this->getTable();
        if ((!$this->getPlatform()->supportsNativeDeleteTrigger() || $this->getBuildProperty('generator.objectModel.emulateForeignKeyConstraints')) && count($table->getReferrers()) > 0) {
            foreach ($table->getReferrers() as $fk) {
                if ( ForeignKey::CASCADE === $fk->getOnDelete()) {
                    return true;
                }
            }
        }

        return false;
    }
156387
static function delete($directory, $force = false) {
        if (self::exists($directory)) {
            /**
             * Check for files
             *
             */
            $contents = scandir($directory);

            if ($force) {
                foreach ($contents as $content) {
                    if ($content != '.' && $content != '..') {
                        if (self::exists($directory . '/' . $content)) {
                            self::delete($directory . '/' . $content, true);
                        } else {
                            self::delete($directory . '/' . $content);
                        }
                    }
                }

                rmdir($directory);
            } else {
                $contents = scandir($directory);

                rmdir($directory);
            }

            if (!self::exists($directory)) return true;
        }

        return false;
    }
1364567
public function del($term, $force = null)
    {
        if (false === $this->has_table()) return false;

        $force !== null or $force = $this->is_destructive;

        $term = $this->normalize_term($term);

        if (true === $force) {
            $return = $this->db->delete($this->table, $term);
        } else {
            $return = $this->trash_it($term, true);
        }

        if ( ! $return) {
            $this->set_error($this->db->error());
            return false;
        }

        return $return;
    }
181628
public function deleteUserForced($uid)
    {
        $return['error'] = true;

        $query = "DELETE FROM {$this->config->table_users} WHERE id = :uid";
        $query_prepared = $this->dbh->prepare($query);

        if (!$query_prepared->execute(['uid' => $uid])) {
            $return['message'] = $this->__lang("system_error") . " #05";

            return $return;
        }

        $query = "DELETE FROM {$this->config->table_sessions} WHERE uid = :uid";
        $query_prepared = $this->dbh->prepare($query);

        if (!$query_prepared->execute(['uid' => $uid])) {
            $return['message'] = $this->__lang("system_error") . " #06";

            return $return;
        }

        $query = "DELETE FROM {$this->config->table_requests} WHERE uid = :uid";
        $query_prepared = $this->dbh->prepare($query);

        if (!$query_prepared->execute(['uid' => $uid])) {
            $return['message'] = $this->__lang("system_error") . " #07";

            return $return;
        }

        $return['error'] = false;
        $return['message'] = $this->__lang("account_deleted");

        return $return;
    }
1231361
public function forceMaxInitialMigration()
    {
        $forcedInitialMigration = null;
        foreach (array_reverse($this->getMigrations()) as $migration) {
            /* @var \Doctrine\DBAL\Migrations\Version $migration */
            if ($migration->isMigrated() && !$migration->getMigration() instanceof RepeatableMigrationInterface) {
                break;
            }
            $forcedInitialMigration = $migration;
        }
        $this->forcedInitialMigration = $forcedInitialMigration;
    }
697220
public function delete($deleteReference = false)
    {
        $returnValue = (bool) false;
        $returnValue = $this->getImplementation()->delete($this, $deleteReference);
        return (bool) $returnValue;
    }