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

setDoubleValue() public method

public setDoubleValue ( double $value = null )
$value double
    public function setDoubleValue($value = null)
    {
        if ($value != null && !is_double($value)) {
            throw new \InvalidArgumentException('Expected an double value.');
        }
        $this->type = Cell::DOUBLE_TYPE;
        $this->value = $value;
        return $this;
    }

Usage Example

Beispiel #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;
 }