public function __construct(Object\IDataProperty $DataProperty, Relational\IColumn $Column)
{
parent::__construct($DataProperty);
if ($DataProperty->IsIdentity() && !$Column->IsPrimaryKey()) {
throw new MappingException('Cannot map an identity property to a non primary key column %s.%s', $Column->GetTable()->GetName(), $Column->GetName());
} else {
if ($Column->IsPrimaryKey() && !$DataProperty->IsIdentity()) {
throw new MappingException('Cannot map an non identity property to a primary key column %s.%s', $Column->GetTable()->GetName(), $Column->GetName());
} else {
if ($Column->IsPrimaryKey() && $DataProperty->IsIdentity()) {
$this->IsIdentityPrimaryKeyMapping = true;
}
}
}
$this->DataProperty = $DataProperty;
$this->Column = $Column;
}