Storm\Drivers\Base\Mapping\Mappings\EntityPropertyToOneRelationMapping::__construct PHP Method

__construct() public method

public __construct ( Storm\Core\Object\IEntityProperty $EntityProperty, Storm\Core\Relational\IToOneRelation $ToOneRelation )
$EntityProperty Storm\Core\Object\IEntityProperty
$ToOneRelation Storm\Core\Relational\IToOneRelation
    public function __construct(Object\IEntityProperty $EntityProperty, Relational\IToOneRelation $ToOneRelation)
    {
        parent::__construct($EntityProperty, $ToOneRelation);
        $this->EntityProperty = $EntityProperty;
        $this->ToOneRelation = $ToOneRelation;
    }

Usage Example

 public function __construct(Object\IEntityProperty $EntityProperty, Relational\IToOneRelation $ToOneRelation)
 {
     if ($EntityProperty->IsOptional()) {
         throw MappingException::OptionalEntityInLazyContext($ToOneRelation);
     }
     parent::__construct($EntityProperty, $ToOneRelation);
 }
All Usage Examples Of Storm\Drivers\Base\Mapping\Mappings\EntityPropertyToOneRelationMapping::__construct