コード例 #1
0
ファイル: PDOStatement.php プロジェクト: rtshome/pgbabylon
 public function setAttribute($attribute, $value)
 {
     if ($this->_statement instanceof \PDOStatement) {
         return $this->_statement->setAttribute($attribute, $value);
     }
     return false;
 }
コード例 #2
0
ファイル: Pdo.php プロジェクト: jorgenils/zend-framework
 /**
  * Set a statement attribute.
  *
  * @param string $key Attribute name.
  * @param mixed  $val Attribute value.
  * @return bool
  * @throws Zend_Db_Statement_Exception
  */
 public function setAttribute($key, $val)
 {
     try {
         return $this->_stmt->setAttribute($key, $val);
     } catch (PDOException $e) {
         require_once 'Zend/Db/Statement/Exception.php';
         throw new Zend_Db_Statement_Exception($e->getMessage());
     }
 }
コード例 #3
0
ファイル: PDOStatement.php プロジェクト: compeek/pdo-wrapper
 /**
  * @param int $attribute
  * @param mixed $value
  * @return bool
  * @throws \Compeek\PDOWrapper\NotConnectedException
  */
 public function setAttribute($attribute, $value)
 {
     $this->requireConnection();
     $result = $this->pdoStatement->setAttribute($attribute, $value);
     if ($result) {
         $this->pdoStatementAttributes[$attribute] = $value;
     }
     return $result;
 }
コード例 #4
0
ファイル: Pdo.php プロジェクト: aisuhua/phalcon-php
 /**
  * Moves internal resulset cursor to another position letting us to fetch a certain row
  *
  *<code>
  *  $result = $connection->query("SELECT * FROM robots ORDER BY name");
  *  $result->dataSeek(2); // Move to third row on result
  *  $row = $result->fetch(); // Fetch third row
  *</code>
  *
  * @param int $number
  * @return null|false
  */
 public function dataSeek($number)
 {
     /* Validation */
     if (is_int($number) === false) {
         return;
     }
     $this->_rowOffset = $number;
     if ($this->_pdoStatement->setAttribute(\PDO::ATTR_CURSOR, \PDO::CURSOR_SCROLL) === false) {
         return false;
     }
 }
コード例 #5
0
 public function setFetchSize($fetchSize)
 {
     $this->checkClosed();
     $this->stmt->setAttribute(\PDO::ATTR_PREFETCH, \blaze\lang\Integer::asNative($fetchSize));
 }
コード例 #6
0
ファイル: cvsImporter.php プロジェクト: urukalo/csvimporter
 /**
  * csvImporter constructor.
  * @param PDOStatement $dbh
  */
 public function __construct($dbh, $csvPath)
 {
     $dbh->setAttribute(\PDO::ATTR_EMULATE_PREPARES, true);
     $this->dbh = $dbh;
     $this->csvPath = $csvPath;
 }
コード例 #7
0
 /**
  * @param int $attribute
  * @param mixed $value
  * @return bool
  */
 public function setAttribute($attribute, $value)
 {
     $archLog = array('method' => 'PDOStatement::setAttribute', 'input' => array('attribute' => $attribute, 'value' => $value), 'output' => $this->PDOStatement->setAttribute($attribute, $value), 'pointer' => $this->assignPointerString());
     return self::setLogReturnOutput($archLog);
 }