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

setValue() public method

public setValue ( string $value = null )
$value string
    public function setValue($value = null)
    {
        $this->type = Cell::STRING_TYPE;
        $this->value = $value;
        return $this;
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Converts a TS PB Cell to a core lib Cell
  *
  * @param TsColumnDescription $column
  * @param TsCell $tsCell
  * @return Cell
  */
 public static function fromPbCell(TsColumnDescription $column, TsCell $tsCell)
 {
     $cell = new Cell($column->getName());
     switch ($column->getType()) {
         case TsColumnType::BOOLEAN:
             $cell->setBooleanValue($tsCell->getBooleanValue());
             break;
         case TsColumnType::BLOB:
             $cell->setBlobValue($tsCell->getVarcharValue());
             break;
         case TsColumnType::SINT64:
             $cell->setIntValue($tsCell->getSint64Value());
             break;
         case TsColumnType::DOUBLE:
             $cell->setDoubleValue($tsCell->getDoubleValue());
             break;
         case TsColumnType::TIMESTAMP:
             $cell->setTimestampValue($tsCell->getTimestampValue());
             break;
         default:
             $cell->setValue($tsCell->getVarcharValue());
             break;
     }
     return $cell;
 }