private readProperty ( ReflectionProperty $property, DMS\Filter\Mapping\ClassMetadataInterface $metadata ) | ||
$property | ReflectionProperty | |
$metadata | DMS\Filter\Mapping\ClassMetadataInterface |
private function readProperty(ReflectionProperty $property, ClassMetadataInterface $metadata)
{
// Skip if this property is not from this class
if ($property->getDeclaringClass()->getName() != $metadata->getClassName()) {
return;
}
//Iterate over all annotations
foreach ($this->reader->getPropertyAnnotations($property) as $rule) {
//Skip is its not a rule
if (!$rule instanceof Rules\Rule) {
continue;
}
//Add Rule
$metadata->addPropertyRule($property->getName(), $rule);
}
}