/** * Get the PHP snippet for binding a value to a column. * Warning: duplicates logic from DBOracle::bindValue(). * Any code modification here must be ported there. */ public function getColumnBindingPHP($column, $identifier, $columnValueAccessor, $tab = "\t\t\t") { if ($column->getPDOType() == PropelTypes::CLOB_EMU) { return sprintf("%s\$stmt->bindParam(%s, %s, %s, strlen(%s));\r\n", $tab, $identifier, $columnValueAccessor, PropelTypes::getPdoTypeString($column->getType()), $columnValueAccessor); } return parent::getColumnBindingPHP($column, $identifier, $columnValueAccessor, $tab); }
/** * Get the PHP snippet for binding a value to a column. * Warning: duplicates logic from DBAdapter::bindValue(). * Any code modification here must be ported there. */ public function getColumnBindingPHP($column, $identifier, $columnValueAccessor, $tab = "\t\t\t") { $script = ''; $hasValuePreparation = false; if ($column->isTemporalType()) { // nothing special, the internal value was already properly formatted by the setter } 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::getPdoTypeString($column->getType())); return preg_replace('/^(.+)/m', $tab . '$1', $script); }