Exemplo n.º 1
0
 public static function create($value)
 {
     if (!is_array($value) || !Arrays::isAssoc($value)) {
         throw new \InvalidArgumentException('Map requires an associative array');
     }
     return parent::create($value);
 }
Exemplo n.º 2
0
 public function assembleSetExpression(SetExpression $set)
 {
     $values = $this->assembleSegments((array) $set->getValue());
     return '{' . implode(',', $values) . '}';
 }
Exemplo n.º 3
0
 public function testSetExpression()
 {
     $this->assertEquals("{'test',1}", CqlAssembler::stringify(SetExpression::create(['test', 1])));
     $this->assertEquals("\"testfield\" + {'test'}", CqlAssembler::stringify(AdditionExpression::create(FieldExpression::create('testfield'), SetExpression::create('test'))));
 }
Exemplo n.º 4
0
 public function testSetExpression()
 {
     $this->assertEquals("{'test':'myval','test2':2}", CqlAssembler::stringify(MapExpression::create(['test' => 'myval', 'test2' => 2])));
     $this->assertEquals("\"testfield\" + {'test'}", CqlAssembler::stringify(AdditionExpression::create(FieldExpression::create('testfield'), SetExpression::create('test'))));
 }