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


PHP Table::getVendorInfoForType方法代码示例

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


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

示例1: generateBlockStorage

 /**
  * Generate oracle block storage
  *
  * @param Table|Index $object       object with vendor parameters
  * @param boolean     $isPrimaryKey is a primary key vendor part
  *
  * @return string oracle vendor sql part
  */
 public function generateBlockStorage($object, $isPrimaryKey = false)
 {
     $vendorSpecific = $object->getVendorInfoForType('oracle');
     if ($vendorSpecific->isEmpty()) {
         return '';
     }
     if ($isPrimaryKey) {
         $physicalParameters = "\nUSING INDEX\n";
         $prefix = "PK";
     } else {
         $physicalParameters = "\n";
         $prefix = "";
     }
     if ($vendorSpecific->hasParameter($prefix . 'PCTFree')) {
         $physicalParameters .= "PCTFREE " . $vendorSpecific->getParameter($prefix . 'PCTFree') . "\n";
     }
     if ($vendorSpecific->hasParameter($prefix . 'InitTrans')) {
         $physicalParameters .= "INITRANS " . $vendorSpecific->getParameter($prefix . 'InitTrans') . "\n";
     }
     if ($vendorSpecific->hasParameter($prefix . 'MinExtents') || $vendorSpecific->hasParameter($prefix . 'MaxExtents') || $vendorSpecific->hasParameter($prefix . 'PCTIncrease')) {
         $physicalParameters .= "STORAGE\n(\n";
         if ($vendorSpecific->hasParameter($prefix . 'MinExtents')) {
             $physicalParameters .= "    MINEXTENTS " . $vendorSpecific->getParameter($prefix . 'MinExtents') . "\n";
         }
         if ($vendorSpecific->hasParameter($prefix . 'MaxExtents')) {
             $physicalParameters .= "    MAXEXTENTS " . $vendorSpecific->getParameter($prefix . 'MaxExtents') . "\n";
         }
         if ($vendorSpecific->hasParameter($prefix . 'PCTIncrease')) {
             $physicalParameters .= "    PCTINCREASE " . $vendorSpecific->getParameter($prefix . 'PCTIncrease') . "\n";
         }
         $physicalParameters .= ")\n";
     }
     if ($vendorSpecific->hasParameter($prefix . 'Tablespace')) {
         $physicalParameters .= "TABLESPACE " . $vendorSpecific->getParameter($prefix . 'Tablespace');
     }
     return $physicalParameters;
 }
开发者ID:smoqs,项目名称:Propel2,代码行数:45,代码来源:OraclePlatform.php

示例2: getTableOptions

 protected function getTableOptions(Table $table)
 {
     $dbVI = $table->getDatabase()->getVendorInfoForType('mysql');
     $tableVI = $table->getVendorInfoForType('mysql');
     $vi = $dbVI->getMergedVendorInfo($tableVI);
     $tableOptions = array();
     // List of supported table options
     // see http://dev.mysql.com/doc/refman/5.5/en/create-table.html
     $supportedOptions = array('AutoIncrement' => 'AUTO_INCREMENT', 'AvgRowLength' => 'AVG_ROW_LENGTH', 'Charset' => 'CHARACTER SET', 'Checksum' => 'CHECKSUM', 'Collate' => 'COLLATE', 'Connection' => 'CONNECTION', 'DataDirectory' => 'DATA DIRECTORY', 'Delay_key_write' => 'DELAY_KEY_WRITE', 'DelayKeyWrite' => 'DELAY_KEY_WRITE', 'IndexDirectory' => 'INDEX DIRECTORY', 'InsertMethod' => 'INSERT_METHOD', 'KeyBlockSize' => 'KEY_BLOCK_SIZE', 'MaxRows' => 'MAX_ROWS', 'MinRows' => 'MIN_ROWS', 'Pack_Keys' => 'PACK_KEYS', 'PackKeys' => 'PACK_KEYS', 'RowFormat' => 'ROW_FORMAT', 'Union' => 'UNION');
     foreach ($supportedOptions as $name => $sqlName) {
         $parameterValue = null;
         if ($vi->hasParameter($name)) {
             $parameterValue = $vi->getParameter($name);
         } elseif ($vi->hasParameter($sqlName)) {
             $parameterValue = $vi->getParameter($sqlName);
         }
         // if we have a param value, then parse it out
         if (!is_null($parameterValue)) {
             // if the value is numeric, then there is no need for quotes
             $parameterValue = is_numeric($parameterValue) ? $parameterValue : $this->quote($parameterValue);
             $tableOptions[] = sprintf('%s=%s', $sqlName, $parameterValue);
         }
     }
     return $tableOptions;
 }
开发者ID:kalaspuffar,项目名称:php-orm-benchmark,代码行数:25,代码来源:MysqlPlatform.php

示例3: getResetSchemaDDL

 public function getResetSchemaDDL(Table $table)
 {
     $vi = $table->getVendorInfoForType('pgsql');
     if ($vi->hasParameter('schema')) {
         return "\nSET search_path TO public;\n";
     }
 }
开发者ID:RafalFilipek,项目名称:Propel2,代码行数:7,代码来源:PgsqlPlatform.php


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