Ejemplo n.º 1
0
 /**
  * @throws \InvalidArgumentException
  */
 private function applyFieldRule()
 {
     $this->rule = $this->rule ?: FieldRule::A_SINGLE_VALUE();
     if ($this->isASet() && !$this->type->allowedInSet()) {
         throw new \InvalidArgumentException(sprintf('Field [%s] with type [%s] cannot be used in a set.', $this->name, $this->type->getTypeValue()));
     }
 }
Ejemplo n.º 2
0
 public function testGetRule()
 {
     $this->assertInstanceOf('Gdbots\\Pbjc\\Enum\\FieldRule', $this->field->getRule());
     $this->assertEquals(FieldRule::A_SINGLE_VALUE(), $this->field->getRule());
 }