public convertToPhpValue ( mixed $value, Doctrine\DBAL\Platforms\AbstractPlatform $platform ) : Dumplie\CustomerService\Domain\PaymentState | ||
$value | mixed | |
$platform | Doctrine\DBAL\Platforms\AbstractPlatform | |
리턴 | Dumplie\CustomerService\Domain\PaymentState |
public function convertToPhpValue($value, AbstractPlatform $platform)
{
if (is_null($value)) {
return [];
}
switch ($value) {
case 1:
return new PaymentState\Unpaid();
case 2:
return new PaymentState\Paid();
case 3:
return new PaymentState\Rejected();
default:
ConversionException::conversionFailed($value, $this->getName());
}
}