當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Column::getPDOType方法代碼示例

本文整理匯總了PHP中Propel\Generator\Model\Column::getPDOType方法的典型用法代碼示例。如果您正苦於以下問題:PHP Column::getPDOType方法的具體用法?PHP Column::getPDOType怎麽用?PHP Column::getPDOType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Propel\Generator\Model\Column的用法示例。


在下文中一共展示了Column::getPDOType方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getColumnBindingPHP

 /**
  * Get the PHP snippet for binding a value to a column.
  * Warning: duplicates logic from OracleAdapter::bindValue().
  * Any code modification here must be ported there.
  */
 public function getColumnBindingPHP(Column $column, $identifier, $columnValueAccessor, $tab = "            ")
 {
     if ($column->getPDOType() == PropelTypes::CLOB_EMU) {
         return sprintf("%s\$stmt->bindParam(%s, %s, %s, strlen(%s));\n", $tab, $identifier, $columnValueAccessor, PropelTypes::getPdoTypeString($column->getType()), $columnValueAccessor);
     }
     return parent::getColumnBindingPHP($column, $identifier, $columnValueAccessor, $tab);
 }
開發者ID:smoqs,項目名稱:Propel2,代碼行數:12,代碼來源:OraclePlatform.php

示例2: testGetPdoType

 /**
  * @dataProvider providePdoTypes
  *
  */
 public function testGetPdoType($mappingType, $pdoType)
 {
     $domain = $this->getDomainMock();
     $domain->expects($this->any())->method('getType')->will($this->returnValue($mappingType));
     $column = new Column();
     $column->setDomain($domain);
     $column->setType($mappingType);
     $this->assertSame($pdoType, $column->getPDOType());
 }
開發者ID:dracony,項目名稱:forked-php-orm-benchmark,代碼行數:13,代碼來源:ColumnTest.php

示例3: getColumnBindingPHP

 public function getColumnBindingPHP(Column $column, $identifier, $columnValueAccessor, $tab = "            ")
 {
     // FIXME - This is a temporary hack to get around apparent bugs w/ PDO+MYSQL
     // See http://pecl.php.net/bugs/bug.php?id=9919
     if ($column->getPDOType() === \PDO::PARAM_BOOL) {
         return sprintf("\n%s\$stmt->bindValue(%s, (int) %s, PDO::PARAM_INT);", $tab, $identifier, $columnValueAccessor);
     }
     return parent::getColumnBindingPHP($column, $identifier, $columnValueAccessor, $tab);
 }
開發者ID:cocofile,項目名稱:cocofile,代碼行數:9,代碼來源:MysqlPlatform.php

示例4: getColumnBindingPHP

 /**
  * Get the PHP snippet for binding a value to a column.
  * Warning: duplicates logic from AdapterInterface::bindValue().
  * Any code modification here must be ported there.
  */
 public function getColumnBindingPHP(Column $column, $identifier, $columnValueAccessor, $tab = "            ")
 {
     $script = '';
     if ($column->isTemporalType()) {
         $columnValueAccessor = $columnValueAccessor . " ? " . $columnValueAccessor . "->format(\"" . $this->getTimeStampFormatter() . "\") : null";
     } elseif ($column->isLobType()) {
         // we always need to make sure that the stream is rewound, otherwise nothing will
         // get written to database.
         $script .= "\nif (is_resource({$columnValueAccessor})) {\n    rewind({$columnValueAccessor});\n}";
     }
     $script .= sprintf("\n\$stmt->bindValue(%s, %s, %s);", $identifier, $columnValueAccessor, PropelTypes::getPdoTypeStringFromPdoType($column->getPDOType()));
     return preg_replace('/^(.+)/m', $tab . '$1', $script);
 }
開發者ID:eat24,項目名稱:propel,代碼行數:18,代碼來源:DefaultPlatform.php


注:本文中的Propel\Generator\Model\Column::getPDOType方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。