has() public method

Returns whether a field with the given key exists.
public has ( string $key ) : boolean
$key string
return boolean
Example #1
0
 public function testMergeAddsFieldsFromAnotherGroup()
 {
     $group1 = new FieldGroup('author');
     $group1->add($field1 = new TestField('firstName'));
     $group2 = new FieldGroup('publisher');
     $group2->add($field2 = new TestField('lastName'));
     $group1->merge($group2);
     $this->assertTrue($group1->has('lastName'));
     $this->assertEquals(new PropertyPath('publisher.lastName'), $group1->get('lastName')->getPropertyPath());
 }