| 1 | <?php |
||
| 7 | abstract class DocumentType extends DBAL\Types\StringType |
||
| 8 | { |
||
| 9 | const CPF = 'cpf'; |
||
| 10 | const CNPJ = 'cnpj'; |
||
| 11 | const CNH = 'cnh'; |
||
| 12 | const PISPASEP = 'pispasep'; |
||
| 13 | const CNS = 'cns'; |
||
| 14 | const RENAVAM = 'renavam'; |
||
| 15 | |||
| 16 | abstract public function factory($number); |
||
| 17 | |||
| 18 | abstract public function getLength(); |
||
| 19 | |||
| 20 | 6 | public function isFixed() |
|
| 24 | |||
| 25 | /** |
||
| 26 | * Converts a value from its PHP representation to its database representation |
||
| 27 | * of this type. |
||
| 28 | * |
||
| 29 | * @param \Brazanation\Documents\Cnpj $value The value to convert. |
||
| 30 | * @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform The currently used database platform. |
||
| 31 | * |
||
| 32 | * @return null|string The database representation of the value. |
||
| 33 | */ |
||
| 34 | 12 | public function convertToDatabaseValue($value, DBAL\Platforms\AbstractPlatform $platform) |
|
| 42 | |||
| 43 | /** |
||
| 44 | * Converts a value from its database representation to its PHP representation |
||
| 45 | * of this type. |
||
| 46 | * |
||
| 47 | * @param string $value The value to convert. |
||
| 48 | * @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform The currently used database platform. |
||
| 49 | * |
||
| 50 | * @return null|\Brazanation\Documents\Cnpj The PHP representation of the value. |
||
| 51 | */ |
||
| 52 | 12 | public function convertToPHPValue($value, DBAL\Platforms\AbstractPlatform $platform) |
|
| 60 | |||
| 61 | /** |
||
| 62 | * @inheritdoc |
||
| 63 | */ |
||
| 64 | 6 | public function getSQLDeclaration(array $fieldDeclaration, DBAL\Platforms\AbstractPlatform $platform) |
|
| 70 | } |
||
| 71 |