1 | <?php |
||
17 | final class JudiciaryProcess extends AbstractDocument |
||
18 | { |
||
19 | const LENGTH = 20; |
||
20 | |||
21 | const LABEL = 'PROCESSO_JUDICIAL'; |
||
22 | |||
23 | const REGEX = '/^([\d]{7})([\d]{2})([\d]{4})([\d]{1})([\d]{2})([\d]{0,4})$/'; |
||
24 | |||
25 | /** |
||
26 | * Identify sequential number of process by origin unit. |
||
27 | * |
||
28 | * @var string |
||
29 | */ |
||
30 | private $sequentialNumber; |
||
31 | |||
32 | /** |
||
33 | * Identifies the year the process is filed. |
||
34 | * |
||
35 | * @var string |
||
36 | */ |
||
37 | private $year; |
||
38 | |||
39 | /** |
||
40 | * Identifies segment of the Judiciary. |
||
41 | * |
||
42 | * @var string |
||
43 | */ |
||
44 | private $judiciary; |
||
45 | |||
46 | /** |
||
47 | * Identifies of court from Judiciary. |
||
48 | * |
||
49 | * @var string |
||
50 | */ |
||
51 | private $court; |
||
52 | |||
53 | /** |
||
54 | * unit of origin of the process. |
||
55 | * |
||
56 | * @var string |
||
57 | */ |
||
58 | private $origin; |
||
59 | |||
60 | 11 | public function __construct($number) |
|
66 | |||
67 | /** |
||
68 | * Extract identification numbers. |
||
69 | * |
||
70 | * @param string $number |
||
71 | */ |
||
72 | 11 | private function extractNumbers($number) |
|
83 | |||
84 | 2 | public function format() |
|
89 | |||
90 | 11 | protected function extractCheckerDigit($number) |
|
94 | |||
95 | 8 | protected function extractBaseNumber($number) |
|
99 | |||
100 | /** |
||
101 | * Calculate check digit Algoritm Module 97 Base 10 (ISO 7064) |
||
102 | * Anexo VIII da Resolução CNJ no 65, de 16 de dezembro de 2008. |
||
103 | * |
||
104 | * @see http://www.cnj.jus.br/busca-atos-adm?documento=2748 |
||
105 | * @see http://www.cnj.jus.br/images/stories/docs_cnj/resolucao/anexorescnj_65.pdf |
||
106 | * |
||
107 | * @param string $input |
||
108 | * |
||
109 | * @return string |
||
110 | */ |
||
111 | 8 | public function calculateDigit($input) |
|
125 | } |
||
126 |