当前位置: 首页>>代码示例>>PHP>>正文


PHP Table::getName方法代码示例

本文整理汇总了PHP中Doctrine\DBAL\Schema\Table::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP Table::getName方法的具体用法?PHP Table::getName怎么用?PHP Table::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Doctrine\DBAL\Schema\Table的用法示例。


在下文中一共展示了Table::getName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: isTableNotIgnored

 /**
  * @param Table $table
  * @return bool
  */
 public function isTableNotIgnored(Table $table)
 {
     if (!$this->config->hasTableConfig($table->getName())) {
         return true;
     }
     return !$this->config->getTableConfig($table->getName())->isTableIgnored();
 }
开发者ID:digilist,项目名称:snakedumper,代码行数:11,代码来源:TableFilter.php

示例2: buildTable

 /**
  * Get the table's schema object.
  *
  * @param Schema $schema
  * @param string $tableName
  *
  * @return \Doctrine\DBAL\Schema\Table
  */
 public function buildTable(Schema $schema, $tableName)
 {
     $this->table = $schema->createTable($tableName);
     $this->tableName = $this->table->getName();
     $this->addColumns();
     $this->addIndexes();
     $this->setPrimaryKey();
     return $this->table;
 }
开发者ID:nectd,项目名称:nectd-web,代码行数:17,代码来源:BaseTable.php

示例3: buildTable

 /**
  * Get the table's schema object.
  *
  * @param Schema $schema
  * @param string $tableName
  * @param string $aliasName
  * @param string $charset
  * @param string $collate
  *
  * @return \Doctrine\DBAL\Schema\Table
  */
 public function buildTable(Schema $schema, $tableName, $aliasName, $charset, $collate)
 {
     $this->table = $schema->createTable($tableName);
     $this->table->addOption('alias', $aliasName);
     $this->table->addOption('charset', $charset);
     $this->table->addOption('collate', $collate);
     $this->aliasName = $aliasName;
     $this->tableName = $this->table->getName();
     $this->addColumns();
     $this->addIndexes();
     $this->setPrimaryKey();
     return $this->table;
 }
开发者ID:atiarda,项目名称:bolt,代码行数:24,代码来源:BaseTable.php

示例4: acceptForeignKey

 /**
  * @param Table $localTable
  * @param ForeignKeyConstraint $fkConstraint
  */
 public function acceptForeignKey(Table $localTable, ForeignKeyConstraint $fkConstraint)
 {
     // Append the foreign key constraints SQL
     if ($this->_platform->supportsForeignKeyConstraints()) {
         $this->_createFkConstraintQueries = array_merge($this->_createFkConstraintQueries, (array) $this->_platform->getCreateForeignKeySQL($fkConstraint, $localTable->getName()));
     }
 }
开发者ID:poulikov,项目名称:readlater,代码行数:11,代码来源:CreateSchemaSqlCollector.php

示例5: _addTable

 /**
  * @param Table $table
  */
 protected function _addTable(Table $table)
 {
     $tableName = strtolower($table->getName());
     if (isset($this->_tables[$tableName])) {
         throw SchemaException::tableAlreadyExists($tableName);
     }
     $this->_tables[$tableName] = $table;
     $table->setSchemaConfig($this->_schemaConfig);
 }
开发者ID:ncud,项目名称:sagalaya,代码行数:12,代码来源:Schema.php

示例6: addForeignKey

 /**
  * @param DBALTable $KeyTarget Foreign Key (Column: KeySource Name)
  * @param DBALTable $KeySource Foreign Data (Column: Id)
  */
 public function addForeignKey(DBALTable &$KeyTarget, DBALTable $KeySource)
 {
     if (!$this->Database->hasColumn($KeyTarget->getName(), $KeySource->getName())) {
         $KeyTarget->addColumn($KeySource->getName(), 'bigint');
         if ($this->Database->getPlatform()->supportsForeignKeyConstraints()) {
             $KeyTarget->addForeignKeyConstraint($KeySource, array($KeySource->getName()), array('Id'));
         }
     }
 }
开发者ID:BozzaCoon,项目名称:SPHERE-Framework,代码行数:13,代码来源:Structure.php

示例7: renameColumn

 /**
  * Renames a column
  *
  * @param Schema   $schema
  * @param QueryBag $queries
  * @param Table    $table
  * @param string   $oldColumnName
  * @param string   $newColumnName
  */
 public function renameColumn(Schema $schema, QueryBag $queries, Table $table, $oldColumnName, $newColumnName)
 {
     $column = new Column(['column' => $table->getColumn($oldColumnName)]);
     $column->changeName($newColumnName);
     $diff = new TableDiff($table->getName());
     $diff->renamedColumns = [$oldColumnName => $column];
     $renameQuery = new SqlMigrationQuery($this->platform->getAlterTableSQL($diff));
     $queries->addQuery($renameQuery);
 }
开发者ID:ramunasd,项目名称:MigrationBundle,代码行数:18,代码来源:RenameExtension.php

示例8: __construct

 public function __construct(SchemaInformation $schema, \Doctrine\DBAL\Schema\Table $table)
 {
     $this->table = $table;
     $this->schema = $schema;
     $this->name = $table->getName();
     foreach ($this->table->getColumns() as $column) {
         $this->columns[$column->getName()] = new ColumnInformation($this, $table, $column);
     }
 }
开发者ID:alanedwardes,项目名称:carbo,代码行数:9,代码来源:TableInformation.php

示例9: describe

 public function describe($namespace) : array
 {
     if (substr($namespace, -1) != "\\") {
         $namespace .= "\\";
     }
     $tableIdentifier = $this->dbalSchemaTable->getName();
     $methods = ['fetchAll' => $this->describeQueryMethod([], $this->describeQuerySelect('*', $tableIdentifier, []))];
     foreach ($this->dbalSchemaTable->getForeignKeys() as $foreignKeyIdentifier => $foreignKey) {
         $words = explode('_', $foreignKeyIdentifier);
         $camelCased = array_map('ucfirst', $words);
         $foreignKeyMethodIdentifier = join('', $camelCased);
         $where = array_map(function ($methodParameter) {
             return $methodParameter . ' = :' . $methodParameter;
         }, $foreignKey->getLocalColumns());
         $query = $this->describeQuerySelect('*', $tableIdentifier, $where);
         $methods["fetchBy" . $foreignKeyMethodIdentifier] = $this->describeQueryMethod($foreignKey->getLocalColumns(), $query);
     }
     return ['identifier' => $namespace . $this->dbalSchemaTable->getName(), 'properties' => ['columns' => array_keys($this->dbalSchemaTable->getColumns())], 'methods' => $methods];
 }
开发者ID:rikmeijer,项目名称:activerecord.php,代码行数:19,代码来源:Table.php

示例10: checkForForeignKeySourceTable

 public function checkForForeignKeySourceTable($columnName)
 {
     // @var Doctrine\DBAL\Schema\ForeignKeyConstraint[]
     $fks = $this->schema->listTableForeignKeys($this->table->getName());
     foreach ($fks as $f) {
         if (in_array($columnName, $f->getColumns())) {
             return $f->getForeignTableName();
         }
     }
     return '';
 }
开发者ID:jonphipps,项目名称:laravel-api-test,代码行数:11,代码来源:TableFieldsGenerator.php

示例11: acceptTable

 /**
  * @param Table $table
  */
 public function acceptTable(Table $table)
 {
     if (in_array($table->getName(), $this->excludedTables)) {
         return;
     }
     $table->addColumn($this->tenantColumnName, $this->tenantColumnType, array('default' => "federation_filtering_value('" . $this->distributionName . "')"));
     $clusteredIndex = $this->getClusteredIndex($table);
     $indexColumns = $clusteredIndex->getColumns();
     $indexColumns[] = $this->tenantColumnName;
     if ($clusteredIndex->isPrimary()) {
         $table->dropPrimaryKey();
         $table->setPrimaryKey($indexColumns);
     } else {
         $table->dropIndex($clusteredIndex->getName());
         $table->addIndex($indexColumns, $clusteredIndex->getName());
         $table->getIndex($clusteredIndex->getName())->addFlag('clustered');
     }
 }
开发者ID:dracony,项目名称:forked-php-orm-benchmark,代码行数:21,代码来源:MultiTenantVisitor.php

示例12: addTable

 /**
  * Add a table object to the schema
  *
  * @param Table $table table object to add
  *
  * @return void
  */
 public function addTable(Table $table)
 {
     //echo '<h2>addTable()</h2>';
     try {
         $name = $table->getName();
         $len = strlen($this->xPrefix);
         if (substr_compare($name, $this->xPrefix, 0, $len) === 0) {
             $name = substr($name, $len);
             if (empty($this->tableList) || in_array($name, $this->tableList)) {
                 $idGeneratorType = 0;
                 // how should we handle this?
                 $newtable = new Table($name, $table->getColumns(), $table->getIndexes(), $table->getForeignKeys(), $idGeneratorType, $table->getOptions());
                 $this->_addTable($newtable);
             }
         }
         //Debug::dump($table);
     } catch (\Exception $e) {
         \Xoops::getInstance()->events()->triggerEvent('core.exception', $e);
         throw $e;
     }
 }
开发者ID:ming-hai,项目名称:XoopsCore,代码行数:28,代码来源:PrefixStripper.php

示例13: saveTable

 /**
  * @param \Doctrine\DBAL\Schema\Table $table
  * @param \SimpleXMLElement $xml
  */
 private static function saveTable($table, $xml)
 {
     $xml->addChild('name', $table->getName());
     $declaration = $xml->addChild('declaration');
     foreach ($table->getColumns() as $column) {
         self::saveColumn($column, $declaration->addChild('field'));
     }
     foreach ($table->getIndexes() as $index) {
         if ($index->getName() == 'PRIMARY') {
             $autoincrement = false;
             foreach ($index->getColumns() as $column) {
                 if ($table->getColumn($column)->getAutoincrement()) {
                     $autoincrement = true;
                 }
             }
             if ($autoincrement) {
                 continue;
             }
         }
         self::saveIndex($index, $declaration->addChild('index'));
     }
 }
开发者ID:GitHubUser4234,项目名称:core,代码行数:26,代码来源:MDB2SchemaWriter.php

示例14: _generateModel

    /**
     * @param \Doctrine\DBAL\Schema\Table $table
     *
     * @return bool|int
     * @todo convert to Blade stub
     */
    protected function _generateModel(Table $table)
    {
        $_props = [];
        $_name = $table->getName();
        $_modelName = $this->_getModelName($_name);
        try {
            foreach ($table->getColumns() as $_column) {
                $_type = $_column->getType()->getName();
                $_type == 'datetime' && ($_type = 'Carbon');
                $_props[] = ' * @property ' . $_type . ' $' . $_column->getName();
            }
            $_payload = ['tableName' => $_name, 'modelName' => $_modelName, 'namespace' => $this->option('namespace') ?: 'App\\Models', 'props' => $_props];
            $_filename = $this->destination . DIRECTORY_SEPARATOR . $_modelName . '.php';
            $_props = implode(PHP_EOL, $_props);
            $_php = <<<TEXT
<?php namespace {$_payload['namespace']};

use Carbon\\Carbon;
use Illuminate\\Database\\Eloquent\\Model;

/**
{$_props}
*/
class {$_payload['modelName']} extends Model
{
    //******************************************************************************
    //* Members
    //******************************************************************************

    protected \$table = '{$_payload['tableName']}';
}
TEXT;
            return file_put_contents($_filename, $_php);
        } catch (\Exception $_ex) {
            $this->_writeln('  * error examining table "' . $_name . '": ' . $_ex->getMessage());
            return false;
        }
    }
开发者ID:chaoticwave,项目名称:grubworm,代码行数:44,代码来源:Burrow.php

示例15: createTableLabel

 /**
  * @param \Doctrine\DBAL\Schema\Table $table
  *
  * @return string
  */
 private function createTableLabel(Table $table)
 {
     // Start the table
     $label = '<<TABLE CELLSPACING="0" BORDER="1" ALIGN="LEFT">';
     // The title
     $label .= '<TR><TD BORDER="1" COLSPAN="3" ALIGN="CENTER" BGCOLOR="#fcaf3e"><FONT COLOR="#2e3436" FACE="Helvetica" POINT-SIZE="12">' . $table->getName() . '</FONT></TD></TR>';
     // The attributes block
     foreach ($table->getColumns() as $column) {
         $columnLabel = $column->getName();
         $label .= '<TR>';
         $label .= '<TD BORDER="0" ALIGN="LEFT" BGCOLOR="#eeeeec">';
         $label .= '<FONT COLOR="#2e3436" FACE="Helvetica" POINT-SIZE="12">' . $columnLabel . '</FONT>';
         $label .= '</TD><TD BORDER="0" ALIGN="LEFT" BGCOLOR="#eeeeec"><FONT COLOR="#2e3436" FACE="Helvetica" POINT-SIZE="10">' . strtolower($column->getType()) . '</FONT></TD>';
         $label .= '<TD BORDER="0" ALIGN="RIGHT" BGCOLOR="#eeeeec" PORT="col' . $column->getName() . '">';
         if ($table->hasPrimaryKey() && in_array($column->getName(), $table->getPrimaryKey()->getColumns())) {
             $label .= "✷";
         }
         $label .= '</TD></TR>';
     }
     // End the table
     $label .= '</TABLE>>';
     return $label;
 }
开发者ID:neteasy-work,项目名称:hkgbf_crm,代码行数:28,代码来源:Graphviz.php


注:本文中的Doctrine\DBAL\Schema\Table::getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。