DB\Cursor::reset PHP Method

reset() public method

Reset cursor
public reset ( ) : null
return null
    function reset()
    {
        $this->query = [];
        $this->ptr = 0;
    }

Usage Example

Beispiel #1
0
 /**
  * reset and re-initialize the mapper
  * @param bool $mapper
  * @return NULL|void
  */
 public function reset($mapper = true)
 {
     if ($mapper) {
         $this->mapper->reset();
     }
     $this->fieldsCache = array();
     $this->saveCsd = array();
     // set default values
     if (($this->dbsType == 'jig' || $this->dbsType == 'mongo') && !empty($this->fieldConf)) {
         foreach ($this->fieldConf as $field_key => $field_conf) {
             if (array_key_exists('default', $field_conf)) {
                 $val = $field_conf['default'] === \DB\SQL\Schema::DF_CURRENT_TIMESTAMP ? date('Y-m-d H:i:s') : $field_conf['default'];
                 $this->set($field_key, $val);
             }
         }
     }
 }
All Usage Examples Of DB\Cursor::reset