Neos\Flow\Reflection\ClassSchema::hasProperty PHP Method

hasProperty() public method

If the class schema has a certain property.
public hasProperty ( string $propertyName ) : boolean
$propertyName string Name of the property
return boolean
    public function hasProperty($propertyName)
    {
        return array_key_exists($propertyName, $this->properties);
    }

Usage Example

 /**
  * @test
  */
 public function hasPropertyReturnsTrueOnlyForExistingProperties()
 {
     $classSchema = new ClassSchema('SomeClass');
     $classSchema->addProperty('a', 'string');
     $classSchema->addProperty('b', 'integer');
     $this->assertTrue($classSchema->hasProperty('a'));
     $this->assertTrue($classSchema->hasProperty('b'));
     $this->assertFalse($classSchema->hasProperty('c'));
 }