public static function OptionalEntityInLazyContext(Relational\IToOneRelation $ToOneRelation) { throw new self('Cannot map an optional entity property to relation %s in a lazy context, the relationship must be required', get_class($ToOneRelation)); }
public function __construct(Object\IEntityProperty $EntityProperty, Relational\IToOneRelation $ToOneRelation) { if ($EntityProperty->IsOptional()) { throw MappingException::OptionalEntityInLazyContext($ToOneRelation); } parent::__construct($EntityProperty, $ToOneRelation); }