public function __construct($className, \ReflectionProperty $reflectionProperty, Relationship $relationshipAnnotation, $isLazy = false, OrderBy $orderBy = null)
{
$this->className = $className;
$this->propertyName = $reflectionProperty->getName();
$this->reflectionProperty = $reflectionProperty;
$this->relationshipAnnotation = $relationshipAnnotation;
$this->isLazy = $isLazy;
$this->orderBy = $orderBy;
if (null !== $orderBy) {
if (!in_array($orderBy->order, ['ASC', 'DESC'], true)) {
throw new MappingException(sprintf('The order "%s" is not valid', $orderBy->order));
}
}
}