Ejemplo n.º 1
0
 public function setThumbnail($v)
 {
     if ($v instanceof Lob && $v === $this->thumbnail) {
         $changed = $v->isModified();
     } else {
         $changed = $this->thumbnail !== $v;
     }
     if ($changed) {
         if (!$v instanceof Lob) {
             $obj = new Blob();
             $obj->setContents($v);
         } else {
             $obj = $v;
         }
         $this->thumbnail = $obj;
         $this->modifiedColumns[] = MemberPhotoPeer::THUMBNAIL;
     }
 }
Ejemplo n.º 2
0
 public function setGzContent($v)
 {
     if ($v instanceof Lob && $v === $this->gz_content) {
         $changed = $v->isModified();
     } else {
         $changed = $this->gz_content !== $v;
     }
     if ($changed) {
         if (!$v instanceof Lob) {
             $obj = new Blob();
             $obj->setContents($v);
         } else {
             $obj = $v;
         }
         $this->gz_content = $obj;
         $this->modifiedColumns[] = nahoWikiContentPeer::GZ_CONTENT;
     }
 }
Ejemplo n.º 3
0
 /**
  * @see ResultSet::getBlob()
  */
 public function getBlob($column)
 {
     $idx = is_int($column) ? $column - 1 : $column;
     if (!array_key_exists($idx, $this->fields)) {
         throw new SQLException("Invalid resultset column: " . $column);
     }
     if ($this->fields[$idx] === null) {
         return null;
     }
     require_once 'creole/util/Blob.php';
     $b = new Blob();
     $b->setContents($this->fields[$idx]);
     return $b;
 }
Ejemplo n.º 4
0
 /**
  * @param string $paramIndex
  * @param mixed $blob Blob object or string containing data.
  * @return void
  */
 function setBlob($paramIndex, $blob)
 {
     require_once CREOLE_ROOT . 'util/Blob.php';
     if (!$blob instanceof Blob) {
         $b = new Blob();
         $b->setContents($blob);
         $blob = $b;
     }
     $this->lobDescriptors[$paramIndex] = oci_new_descriptor($this->conn->getResource(), OCI_D_LOB);
     $this->lobs[$paramIndex] = $blob;
 }
Ejemplo n.º 5
0
 /**
  * Returns Blob with contents of column value.
  * 
  * @param mixed $column Column name (string) or index (int) starting with 1 (if ResultSet::FETCHMODE_NUM was used).
  * @return Blob New Blob with data from column.
  * @throws SQLException - If the column specified is not a valid key in current field array.
  */
 public function getBlob($column)
 {
     if (is_int($column)) {
         $column--;
     }
     // because Java convention is to start at 1
     if (!array_key_exists($column, $this->fields)) {
         throw new SQLException("Invalid resultset column: " . (is_int($column) ? $column + 1 : $column));
     }
     if ($this->fields[$column] === null) {
         return null;
     }
     require_once 'creole/util/Blob.php';
     $b = new Blob();
     $b->setContents(pg_unescape_bytea($this->fields[$column]));
     return $b;
 }
Ejemplo n.º 6
0
 /**
  * @see ResultSet::getBlob()
  */
 public function getBlob($column)
 {
     if ($this->fetchmode == ResultSet::FETCHMODE_NUM) {
         $column--;
     }
     if (!isset($this->fieldsInResultSet[$column])) {
         throw new SQLException("Invalid resultset column: " . $column);
     }
     if ($this->fields[$column] === null) {
         return null;
     }
     require_once 'creole/util/Blob.php';
     $b = new Blob();
     $b->setContents($this->fields[$column]);
     return $b;
 }
 /**
  * @see ResultSet::getBlob()
  */
 public function getBlob($column)
 {
     require_once 'creole/util/Blob.php';
     $idx = is_int($column) ? $column - 1 : $column;
     if (!array_key_exists($idx, $this->fields)) {
         throw new SQLException("Invalid resultset column: " . $column);
     }
     $data = $this->readLobData($column, ODBC_BINMODE_RETURN, $this->fields[$idx]);
     if (!$data) {
         return null;
     }
     $b = new Blob();
     $b->setContents($data);
     return $b;
 }
Ejemplo n.º 8
0
 /**
  * @see CallableStatement::getBlob()
  */
 function getBlob($paramIndex)
 {
     if (!array_key_exists($paramIndex, $this->boundOutVars)) {
         throw new SQLException('Requesting variable not bound to output var: ' . $paramIndex);
     }
     if ($this->boundOutVars[$paramIndex] === null) {
         return null;
     }
     require_once 'creole/util/Blob.php';
     $b = new Blob();
     $b->setContents($this->boundOutVars[$paramIndex]);
     return $b;
 }
Ejemplo n.º 9
0
 /**
  * Set the value of [text] column.
  * 
  * @param      string $v new value
  * @return     void
  */
 public function setText($v)
 {
     // if the passed in parameter is the *same* object that
     // is stored internally then we use the Lob->isModified()
     // method to know whether contents changed.
     if ($v instanceof Lob && $v === $this->text) {
         $changed = $v->isModified();
     } else {
         $changed = $this->text !== $v;
     }
     if ($changed) {
         if (!$v instanceof Lob) {
             $obj = new Blob();
             $obj->setContents($v);
         } else {
             $obj = $v;
         }
         $this->text = $obj;
         $this->modifiedColumns[] = ImportErrorPeer::TEXT;
     }
 }
Ejemplo n.º 10
0
 public function setFiles($v)
 {
     if ($v instanceof Lob && $v === $this->files) {
         $changed = $v->isModified();
     } else {
         $changed = $this->cover !== $v;
     }
     if ($changed) {
         if (!$v instanceof Lob) {
             $obj = new Blob();
             $obj->setContents($v);
         } else {
             $obj = $v;
         }
         $this->files = $obj;
         $this->modifiedColumns[] = CatalogCopiedPeer::FILES;
     }
 }
Ejemplo n.º 11
0
 /**
  * Performs sqlite_udf_decode_binary on binary data.
  * @see ResultSet::getBlob()
  */
 public function getBlob($column)
 {
     $idx = is_int($column) ? $column - 1 : $column;
     if (!array_key_exists($idx, $this->fields)) {
         throw new SQLException("Invalid resultset column: " . $column);
     }
     if ($this->fields[$idx] === null) {
         return null;
     }
     require_once CREOLE_ROOT . 'util/Blob.php';
     $b = new Blob();
     $b->setContents(sqlite_udf_decode_binary($this->fields[$idx]));
     return $b;
 }