Remove table

@param \TechPromux\DynamicQueryBundle\Entity\MetadataTable $table
542406
public function removeTable(\TechPromux\DynamicQueryBundle\Entity\MetadataTable $table)
    {
        $this->tables->removeElement($table);
    }
879573
public function from(string $table = null): Delete
    {
        $this->from = [];
        if (!\is_string($table) && !\is_array($table)) {
            throw new InvalidArgumentException('$table has to be an array or a string');
        }
        $this->from = $this->namesClass->parse($table, true);

        return $this;
    }
525761
private function removeMappingsFromTraits(ClassMetadata $metadata): void
    {
        $traits = $this->getTraits($metadata->name);

        foreach ($traits as $trait) {
            $trait = new \ReflectionClass($trait);

            /**
             * @var \ReflectionProperty $property
             */
            foreach ($trait->getProperties() as $property) {
                $name = $property->getName();

                if (isset($metadata->fieldMappings[$name])) {
                    $mapping = $metadata->fieldMappings[$name];

                    unset(
                        $metadata->fieldMappings[$name],
                        $metadata->fieldNames[$mapping['columnName']],
                        $metadata->columnNames[$name]
                    );
                }
            }
        }
    }
283518
final public function removeFromJunction($table, $masterValue, $masterColumn = self::PARAM_JUNCTION_MASTER_COLUMN)
    {
        // Support for multiple removal
        if (!is_array($masterValue)) {
            $masterValue = array($masterValue);
        }

        return $this->db->delete()
                        ->from($table)
                        ->whereIn($masterColumn, $masterValue)
                        ->execute();
    }
1282307
protected function whitelistTable($table) {
        if(is_array($table)) {
            foreach ($table as $t) {
                $this->query->addToTableWhitelist($t);
            }
        }
        else {
            $this->query->addToTableWhitelist($table);
        }
    }
1216499
public function cleanup($table)
    {
        $this->checkTable($table);

        if (!$this->param('dry-run')) {
            $okayToDestroy = $this->in(__('Are you sure? This will irreversibly delete files'), ['y', 'n'], 'n');
            if ($okayToDestroy === 'N') {
                $this->out(__('Aborted, no files deleted.'));
                $this->_stop();
            }
        } else {
            $this->out(__('<info>Performing dry run cleanup.</info>'));
            $this->out($this->nl(0));
        }

        $config = $this->Table->behaviors()->Proffer->config();

        // Get the root upload folder for this table
        $uploadFieldFolders = glob(WWW_ROOT . 'files' . DS . strtolower($table) . DS . '*');

        // Loop through each upload field configured for this table (field)
        foreach ($uploadFieldFolders as $fieldFolder) {
            // Loop through each instance of an upload for this field (seed)
            $pathFieldName = pathinfo($fieldFolder, PATHINFO_BASENAME);
            $uploadFolders = glob($fieldFolder . DS . '*');
            foreach ($uploadFolders as $seedFolder) {
                // Does the seed exist in the db?
                $seed = pathinfo($seedFolder, PATHINFO_BASENAME);

                foreach ($config as $field => $settings) {
                    if ($pathFieldName != $field) {
                        continue;
                    }

                    $targets = [];

                    $record = $this->{$this->Table->alias()}->find()
                        ->select([
                            $field,
                            $settings['dir']
                        ])
                        ->where([
                            $settings['dir'] => $seed
                        ])
                        ->first();

                    if ($record) {
                        $record = $record->toArray();
                    } else {
                        $record = [];
                    }

                    if (!in_array($seed, $record)) {
                        // No it doesn't - remove the folder and it's contents - probably with a user prompt
                        if ($this->param('dry-run')) {
                            if ($this->param('verbose')) {
                                $this->out(__("Would remove folder `$seedFolder`"));
                            } else {
                                $this->out(__("Would remove folder `$seed`"));
                            }
                        } else {
                            array_map('unlink', glob($seedFolder . DS . '*'));
                            rmdir($seedFolder);

                            if ($this->param('verbose')) {
                                $this->out(__("Remove `$seedFolder` folder and contents"));
                            } else {
                                $this->out(__("Removed `$seed` folder and contents"));
                            }
                        }
                    } else {
                        $files = glob($seedFolder . DS . '*');

                        $filenames = array_map(function ($p) {
                            return pathinfo($p, PATHINFO_BASENAME);
                        }, $files);

                        $targets[] = $record[$field];
                        if (!empty($settings['thumbnailSizes'])) {
                            foreach ($settings['thumbnailSizes'] as $prefix => $dimensions) {
                                $targets[] = $prefix . '_' . $record[$field];
                            }
                        }

                        $filesToRemove = array_diff($filenames, $targets);

                        foreach ($filesToRemove as $file) {
                            if ($this->param('dry-run') && $this->param('verbose')) {
                                $this->out(__("Would delete `$seedFolder" . DS . "$file`"));
                            } elseif ($this->param('dry-run')) {
                                $this->out(__("Would delete `$file`"));
                            } else {
                                unlink($seedFolder . DS . $file);
                                if ($this->param('verbose')) {
                                    $this->out(__("Deleted `$seedFolder" . DS . "$file`"));
                                } else {
                                    $this->out(__("Deleted `$file`"));
                                }
                            }
                        }
                    }
                }
            }
        }

        $this->out($this->nl(0));
        $this->out(__('<info>Completed</info>'));
    }
583223
public function dropAndCreateTable(Table $table)
    {
        $this->tryMethod('dropTable', $table->getQuotedName($this->_platform));
        $this->createTable($table);
    }
1359680
public void deleteTable(String table) {
		try {
			deleteByIdCascade(table, true);
		} catch (SQLException e) {
			throw new GeoPackageException("Failed to delete table: " + table, e);
		}
	}
1055140
private function dropTable($table)
    {
        $database = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster();
        $database->execute("DROP TABLE `$table`");
    }
40318
public function setTable($table)
    {
        $table = trim(filter_var($table, FILTER_SANITIZE_STRING));
        if (empty($table)) {
            throw new InternalServerErrorException('No table name provided.');
        }

        $this->table = $table;
    }
525679
public boolean removeTable(BaseTable table)
    {
        if (m_mapTable != null)
        {
            for (Object objKey : m_mapTable.keySet())
            {
                if (table == m_mapTable.get(objKey))
                {
                    return (m_mapTable.remove(objKey) != null);
                }                
            }
        }
        else
        {
            if (this.getNextTable() != null)
                return this.getNextTable().removeTable(table);
        }
        return super.removeTable(table);
    }
837853
public void clearMetaInfo(FacesContext context, UIComponent table) {
        context.getAttributes().remove(createKey(table));
    }
268040
public function filter($table)
    {
        $table->setMetadata(DataTable::TOTAL_ROWS_BEFORE_LIMIT_METADATA_NAME, $table->getRowsCount());

        if ($this->keepSummaryRow) {
            $summaryRow = $table->getRowFromId(DataTable::ID_SUMMARY_ROW);
        }

        // we delete from 0 to offset
        if ($this->offset > 0) {
            $table->deleteRowsOffset(0, $this->offset);
        }
        // at this point the array has offset less elements. We delete from limit to the end
        if ($this->limit >= 0) {
            $table->deleteRowsOffset($this->limit);
        }

        if ($this->keepSummaryRow && !empty($summaryRow)) {
            $table->addSummaryRow($summaryRow);
        }
    }
418424
public function invalidateCacheTags(TableNode $table) {
    $tags = [];
    foreach ($table->getRows() as $row) {
      $tags[] = $row[0];
    }
    $this->getCore()->invalidateCacheTags($tags);
  }
132151
public function delete($table){        
        $res= FALSE;
        try{
            //Armo y preparo la consulta
            $query= $this->prepareDelete($table, $this->where);
            //Ejecuto la consulta
            $query->execute($this->where_values);            
            //Veo si salio todo bien
            $res= $this->isOk($query);
            //Limpio las variables del AR
            $this->cleanVars();
        } catch (\PDOException $e) {
            $this->cleanVars();
            throw $e;
        }
        return $res;
    }
294966
protected function _delete($table)
	{
		if ($this->qb_limit)
		{
			return 'WITH ci_delete AS (SELECT TOP '.$this->qb_limit.' * FROM '.$table.$this->_compile_wh('qb_where').') DELETE FROM ci_delete';
		}

		return parent::_delete($table);
	}
1031927
public function destroy($schema, $table=null)
    {
        $mapper = $this->_mapper($schema);
        $table = $table ? $this->_connection($schema)->table($table) : $mapper->table();

        $sequencePool = $this->_connection($schema)->sequencePool();
        $sequencePool->initialize();

        // delete any sequences
        foreach ($schema->properties() as $prop) {
            if (property_exists($prop->type, 'sequence')) {
                $sequencePool->delete($mapper->sequenceName($prop));
            }
        }

        // destory the table
        $table->dropIfExists();

        return $this;
    }