コード例 #1
0
 /**
  * @test
  */
 public function itExposesItsKeyAndOperator()
 {
     $key = 'age';
     $operator = new GreaterThan(42);
     $condition = new OperatorCondition($key, $operator);
     $this->assertEquals($key, $condition->getKey());
     $this->assertEquals($operator, $condition->getOperator());
 }
コード例 #2
0
 /**
  * @param OperatorCondition $condition
  *
  * @return string
  */
 public function serialize(OperatorCondition $condition)
 {
     return array('name' => 'operator-condition', 'key' => $condition->getKey(), 'operator' => $this->operatorSerializer->serialize($condition->getOperator()));
 }