Basho\Riak\TimeSeries\Cell::getType PHP Method

getType() public method

public getType ( ) : string
return string
    public function getType()
    {
        return $this->type;
    }

Usage Example

Beispiel #1
0
 /**
  * Converts a core lib Cell to a TS PB Cell
  *
  * @param Cell $cell
  * @return TsCell
  */
 public static function toPbCell(Cell $cell)
 {
     $tsCell = new TsCell();
     switch ($cell->getType()) {
         case Cell::INT_TYPE:
             $tsCell->setSint64Value($cell->getValue());
             break;
         case Cell::DOUBLE_TYPE:
             $tsCell->setDoubleValue($cell->getValue());
             break;
         case Cell::TIMESTAMP_TYPE:
             $tsCell->setTimestampValue($cell->getValue());
             break;
         case Cell::BOOL_TYPE:
             $tsCell->setBooleanValue($cell->getValue());
             break;
         case Cell::BLOB_TYPE:
             if (is_null($cell->getValue())) {
                 $tsCell->setVarcharValue('');
                 break;
             }
         default:
             $tsCell->setVarcharValue($cell->getValue());
     }
     return $tsCell;
 }