This repository has been archived by the owner on Aug 30, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathArrest.php
2008 lines (1740 loc) · 91.3 KB
/
Arrest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
// @@@@@@@@ TODO - Add extra columns to the arrest column to see if expungement, summary, ard, etc...
// @todo make aliases work automatically - they should be able to be read off of the case summary
// @todo think about whether I want to have the charges array check to see if a duplicate
// charge is being added and prevent duplicate charges. A good example of this is if
// a charge is "replaced by information" and then later there is a disposition.
// we probably don't want both the replaced by information and the final disposition on
// the petition. This is especially true if the finally dispoition is Guilty
/********************************************
*
* Arrest.php
* This is the big momma class. It handles everything from parsing a criminal arrest
* to checking if an arrest should be a redaction or expungement
* to checking to see if multiple arrests shoudl be combined.
* It also handles writing an individual arrest to the database and to word files.
*
* Copyright 2011-2015 Community Legal Services
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
********************************************/
require_once("Charge.php");
require_once("Person.php");
require_once("Attorney.php");
require_once("utils.php");
require_once("config.php");
//require_once __DIR__ . '/vendor/phpoffice/phpword/src/PhpWord/Autoloader.php';
//\PhpOffice\PhpWord\Autoloader::register();
require "vendor/autoload.php";
class Arrest
{
private $mdjDistrictNumber;
private $county;
private $OTN;
private $DC;
private $jNumber;
private $jDischargeDate;
private $SID;
private $PID;
private $docketNumber = array();
private $arrestingOfficer;
private $arrestingAgency;
private $arrestDate;
private $complaintDate;
private $judge;
private $DOB;
private $dispositionDate;
private $firstName;
private $lastName;
private $charges = array();
private $costsTotal;
private $costsPaid;
private $costsCharged;
private $costsAdjusted;
private $bailTotal;
private $bailCharged;
private $bailPaid;
private $bailAdjusted;
private $bailTotalTotal;
private $bailChargedTotal;
private $bailPaidTotal;
private $bailAdjustedTotal;
private $isCP;
private $isCriminal;
private $isARDExpungement;
private $isExpungement;
private $isRedaction;
private $isSealable;
private $isHeldForCourt;
private $isOnlyHeldForCourt;
private $isSummaryArrest = FALSE;
private $isArrestSummaryExpungement;
private $isArrestOver70Expungement;
private $isArrestConviction;
private $sealableMaybeReasons = array();
private $pdfFile;
private $pdfFileName;
private $aliases = array();
private $pastAliases = FALSE; // used to stop checking for aliases once we have reached a certain point in the docket sheet
// isMDJ = 0 if this is not an mdj case at all, 1 if this is an mdj case and 2 if this is a CP case that decended from MDJ
private $isMDJ = 0;
private $isJuvenilePhilly = false;
public static $expungementTemplate = "790ExpungementTemplate.docx";
public static $act5Template = "791Act5SealingTemplate.docx";
public static $juvenileExpungementTemplate = "JuvenileExpungementTemplate.docx";
public static $IFPTemplate = "IFPTemplate.docx";
public static $COSTemplate = "MontcoCertificateofServiceTemplate.docx";
public static $overviewTemplate = "overviewTemplate.docx";
protected static $unknownInfo = "N/A";
protected static $unknownOfficer = "Unknown officer";
protected static $unknownAgency = "Unknown agency";
protected static $mdjDistrictNumberSearch = "/Magisterial District Judge\s(.*)/i";
protected static $countySearch = "/\sof\s(\w+)\sCOUNTY/i";
protected static $mdjCountyAndDispositionDateSearch = "/County:\s+(.*)\s+Disposition Date:\s+(.*)/";
protected static $OTNSearch = "/OTN:\s+(\D(\s)?\d+(\-\d)?)/";
protected static $DCSearch = "/District Control Number\s+(\d+)/";
protected static $juvenileNumberSearch = "/Juvenile ID\s+(\d+)/";
protected static $docketSearch = "/Docket Number:\s+((MC|CP)\-\d{2}\-(\D{2})\-\d*\-\d{4})/";
protected static $mdjDocketSearch = "/Docket Number:\s+(MJ\-\d{5}\-(\D{2})\-\d*\-\d{4})/";
protected static $arrestingAgencyAndOfficerSearch = "/Arresting Agency:\s+(.*)\s+Arresting Officer: (\D+)/";
protected static $mdjArrestingOfficerSearch = "/^\s*Arresting Officer (\D+)\s*$/";
protected static $mdjArrestingAgencyAndArrestDateSearch = "/Arresting Agency:\s+(.*)\s+Arrest Date:\s+(\d{1,2}\/\d{1,2}\/\d{4})?/";
protected static $arrestDateSearch = "/Arrest Date:\s+(\d{1,2}\/\d{1,2}\/\d{4})/";
protected static $complaintDateSearch = "/Complaint Date:\s+(\d{1,2}\/\d{1,2}\/\d{4})/";
protected static $mdjComplaintDateSearch = "/Issue Date:\s+(\d{1,2}\/\d{1,2}\/\d{4})/";
protected static $judgeSearch = "/Final Issuing Authority:\s+(.*)/";
protected static $judgeAssignedSearch = "/Judge Assigned:\s+(.*)\s+(Date Filed|Issue Date):/";
#note that the alias name search only captures a maximum of six aliases.
# This is because if you do this: /^Alias Name\r?\n(?:(^.+)\r?\n)*/m, only the last alias will be stored in $1.
# What a crock! I can't figure out a way around this
protected static $aliasNameStartSearch = "/^Alias Name/"; // \r?\n(?:(^.+)\r?\n)(?:(^.+)\r?\n)?(?:(^.+)\r?\n)?(?:(^.+)\r?\n)?(?:(^.+)\r?\n)?(?:(^.+)\r?\n)?/m";
protected static $aliasNameEndSearch = "/CASE PARTICIPANTS/";
protected static $endOfPageSearch = "/(CPCMS|AOPC)\s\d{4}/";
// there are two special judge situations that need to be covered. The first is that MDJ dockets sometimes say
// "magisterial district judge xxx". In that case, there could be overflow to the next line. We want to capture that
// overflow. The second is that sometimes the judge assigned says "migrated judge". We want to make sure we catch that.
protected static $magisterialDistrictJudgeSearch = "/Magisterial District Judge (.*)/";
protected static $judgeSearchOverflow = "/^\s+(\w+\s*\w*)\s*$/";
protected static $migratedJudgeSearch = "/migrated/i";
protected static $DOBSearch = "/Date Of Birth:?\s+(\d{1,2}\/\d{1,2}\/\d{4})/i";
protected static $SIDSearch = "/SID:?\s+(\d{1,3}-\d{1,3}-\d{1,3}-\d{1,3})/i";
protected static $PIDSearch = "/PID\s+(\d+)/i";
protected static $nameSearch = "/^Defendant\s+(.*), (.*)/";
protected static $juvenileNameSearch = "/In the interest of:\s+(.*), a Minor/i";
// ($1 = charge, $2 = disposition, $3 = grade, $4 = code section
protected static $chargesSearch = "/\d\s+\/\s+(.*[^Not])\s+(Not Guilty|Guilty|Nolle Prossed|Nolle Prossed \(Case Dismissed\)|Nolle Prosequi - Administrative|Guilty Plea|Guilty Plea - Negotiated|Guilty Plea - Non-Negotiated|Withdrawn|Withdrawn - Administrative|Charge Changed|Held for Court|Community Court Program|Dismissed - Rule 1013 \(Speedy|Dismissed - Rule 600 \(Speedy|Dismissed - LOP|Dismissed - LOE|Dismissed - Rule 546|Dismissed - Rule 586|Dismissed|Demurrer Sustained|ARD - County Open|ARD - County|ARD|Transferred to Another Jurisdiction|Transferred to Juvenile Division|Quashed|Summary Diversion Completed|Judgment of Acquittal \(Prior to)\s+(\w{0,2})\s+(\w{1,2}\s?\x{A7}\s?\d+(\-|\x{A7}|\w+)*)/u"; // removed "Replacement by Information"
// explanation: .+? - the "?" means to do a lazy match of .+, so it isn't greedy. THe match of 12+ spaces handles the large space after the charges and after the disposition before the next line. The final part is to match the code section that is violated.
/* longer explanation
\d\s+\/\s+ - matches "1 / "
(.+)\s{12,} - matches the charge name followed by a very large space (up to the disposition) and captures the charge name
(\w.+?)(?=\s\s) - matches the disposition. A word character followed by ANY string of characters (non-greedy), that is ultimately followed by two spaces. In other words, we capture "Nolle prossed " and "Withdrawn" both.
\s{12,} - big space
\w{0,2})\s+ - If there is a grading, it will be caught here. If there isn't, this area will be ignored
(\w{1,2}\s?\x{A7}\s? - 1-2 word characters followed by the section symbol, potentially with spaces around the section symbol. This is to capture the beginning of a statute - "18 s "
\d+ - a number or series of numbers
(\-|\x{A7}|\w+)*) - followed by either a "-" a section symbol, or a series of word characters, all 0+ times. This is the clean up at the end of the code section, for example, a code section may be listed as 18 § 2701 §§ A. This would capture the final ss and the A
*/
protected static $chargesSearch2 = "/\d\s+\/\s+(.+)\s{12,}(\w.+?)(?=\s\s)\s{12,}(\w{0,2})\s+(\w{1,2}\s?\x{A7}\s?\d+(\-|\x{A7}|\w+)*)/u";
protected static $ignoreDisps = array("Proceed to Court", "Proceed to Court (Complaint", "Proceed to Court (Complaint Refiled)", "Proceed to Court (SDP)");
// $1 = code section, $3 = grade, $4 = charge, $5 = offense date, $6 = disposition
protected static $mdjChargesSearch = "/^\s*\d\s+((\w|\d|\s(?!\s)|\-|\x{A7}|\*)+)\s{2,}(\w{0,2})\s{2,}([\d|\D]+)\s{2,}(\d{1,2}\/\d{1,2}\/\d{4})\s{2,}(\D{2,})/u";
protected static $chargesSearchOverflow = "/^\s+(\w+\s*\w*)\s*$/";
// disposition date can appear in two different ways (that I have found) and a third for MDJ cases:
// 1) it can appear on its own line, on a line that looks like:
// Status mm/dd/yyyy Final Disposition
// Trial mm/dd/yyyy Final Disposition
// Preliminary Hearing mm/dd/yyyy Final Disposition
// Migrated Dispositional Event mm/dd/yyyy Final Disposition
// 2) on the line after the charge disp
// 3) for MDJ cases, disposition date appears on a line by itself, so it is easier to find
protected static $dispDateSearch = "/(?:Plea|Status|Status of Restitution|Status - Community Court|Status Listing|Migrated Dispositional Event|Trial|Preliminary Hearing|Pre-Trial Conference)\s+(\d{1,2}\/\d{1,2}\/\d{4})\s+Final Disposition/";
protected static $dispDateSearch2 = "/(.*)\s(\d{1,2}\/\d{1,2}\/\d{4})/";
protected static $dischargeDateSearch = "/^\d?\s*(\d{1,2}\/\d{1,2}\/\d{4})$/";
// this is a crazy one. Basically matching whitespace then $xx.xx then whitespace then
// -$xx.xx, etc... The fields show up as Assesment, Payment, Adjustments, Non-Monetary, Total
protected static $costsSearch = "/Totals:\s+\\$([\d\,]+\.\d{2})\s+-?\\$([\d\,]+\.\d{2})\s+-?\\$([\d\,]+\.\d{2})\s+-?\\$([\d\,]+\.\d{2})\s+-?\\$([\d\,]+\.\d{2})/";
protected static $bailSearch = "/Bail.+\\$([\d\,]+\.\d{2})\s+-?\\$([\d\,]+\.\d{2})\s+-?\\$([\d\,]+\.\d{2})\s+-?\\$([\d\,]+\.\d{2})\s+-?\\$([\d\,]+\.\d{2})/";
public function __construct () {}
//getters
public function getMDJDistrictNumber() { return $this->mdjDistrictNumber; }
public function getCounty() { if (!isset($this->county)) $this->setCounty(self::$unknownInfo); return $this->county; }
public function getOTN() { if (!isset($this->OTN)) $this->setOTN(self::$unknownInfo); return $this->OTN; }
public function getDC() { if (!isset($this->DC)) $this->setDC(self::$unknownInfo); return $this->DC; }
public function getJNumber() { if (!isset($this->jNumber)) $this->setJNumber(self::$unknownInfo); return $this->jNumber; }
public function getJDischargeDate() { return $this->jDischargeDate; }
public function getSID() { if (!isset($this->SID)) $this->setSID(self::$unknownInfo); return $this->SID; }
public function getPID() { if (!isset($this->PID)) $this->setPID(self::$unknownInfo); return $this->PID; }
public function getDocketNumber() { return $this->docketNumber; }
public function getArrestingOfficer() { if (!isset($this->arrestingOfficer)) $this->setArrestingOfficer(self::$unknownOfficer); return $this->arrestingOfficer; }
public function getArrestingAgency() { if (!isset($this->arrestingAgency)) $this->setArrestingAgency(self::$unknownAgency); return $this->arrestingAgency; }
public function getArrestDate() { return $this->arrestDate; }
public function getComplaintDate() { return $this->complaintDate; }
// getDispositionDate() exists elsewhere
public function getJudge() { return $this->judge; }
public function getDOB() { return $this->DOB; }
public function getfirstName() { return $this->firstName; }
public function getLastName() { return $this->lastName; }
public function getCharges() { return $this->charges; }
public function getCostsTotal() { if (!isset($this->costsTotal)) $this->setCostsTotal("0"); return $this->costsTotal; }
public function getCostsPaid() { if (!isset($this->costsPaid)) $this->setCostsPaid("0");return $this->costsPaid; }
public function getCostsCharged() { if (!isset($this->costsCharged)) $this->setCostsCharged("0"); return $this->costsCharged; }
public function getCostsAdjusted() { if (!isset($this->costsAdjusted)) $this->setCostsAdjusted("0");return $this->costsAdjusted; }
public function getBailTotal() { if (!isset($this->bailTotal)) $this->setBailTotal("0"); return $this->bailTotal; }
public function getBailPaid() { if (!isset($this->bailPaid)) $this->setBailPaid("0");return $this->bailPaid; }
public function getBailCharged() { if (!isset($this->bailCharged)) $this->setBailCharged("0"); return $this->bailCharged; }
public function getBailAdjusted() { if (!isset($this->bailAdjusted)) $this->setBailAdjusted("0");return $this->bailAdjusted; }
public function getBailTotalTotal() { if (!isset($this->bailTotalTotal)) $this->setBailTotalTotal("0"); return $this->bailTotalTotal; }
public function getBailPaidTotal() { if (!isset($this->bailPaidTotal)) $this->setBailPaidTotal("0");return $this->bailPaidTotal; }
public function getBailChargedTotal() { if (!isset($this->bailChargedTotal)) $this->setBailChargedTotal("0"); return $this->bailChargedTotal; }
public function getBailAdjustedTotal() { if (!isset($this->bailAdjustedTotal)) $this->setBailAdjustedTotal("0");return $this->bailAdjustedTotal; }
public function getIsCP() { return $this->isCP; }
public function getIsCriminal() { return $this->isCriminal; }
public function getIsARDExpungement() { return $this->isARDExpungement; }
public function getIsExpungement() { return $this->isExpungement; }
public function getIsRedaction() { return $this->isRedaction; }
public function getIsSealable() { return $this->isSealable; }
public function getIsHeldForCourt() { return $this->isHeldForCourt; }
public function getIsOnlyHeldForCourt() { return $this->isOnlyHeldForCourt; }
public function getIsSummaryArrest() { return $this->isSummaryArrest; }
public function getSealableMaybeReasons() { return $this->sealableMaybeReasons; }
public function getIsMDJ() { return $this->isMDJ; }
public function getIsJuvenilePhilly() { return $this->isJuvenilePhilly; }
public function getPDFFile() { return $this->pdfFile;}
public function getPDFFileName() { return $this->pdfFileName;}
public function getAliases() { return $this->aliases; }
//setters
public function setMDJDistrictNumber($mdjDistrictNumber) { $this->mdjDistrictNumber = $mdjDistrictNumber; }
public function setCounty($county) { $this->county = ucwords(strtolower($county)); }
public function setOTN($OTN)
{
// OTN could have a "-" before the last digit. It could also have unnecessary spaces.
// We want to chop that off since it isn't important and messes up matching of OTNs
$this->OTN = str_replace(" ", "", str_replace("-", "", $OTN));
}
public function setDC($DC) { $this->DC = $DC; }
public function setJNumber($jNumber) { $this->jNumber = $jNumber; }
public function setJDischargeDate($jDischargeDate) { $this->jDischargeDate = $jDischargeDate; }
public function setSID($SID) { $this->SID = $SID; }
public function setPID($PID) { $this->PID = $PID; }
public function setDocketNumber($docketNumber) { $this->docketNumber = $docketNumber; }
public function setIsSummaryArrest($isSummaryArrest) { $this->isSummaryArrest = $isSummaryArrest; }
public function setArrestingOfficer($arrestingOfficer) { $this->arrestingOfficer = ucwords(strtolower($arrestingOfficer)); }
// when we set the arresting agency, replace any string "PD" with "Police Dept"
public function setArrestingAgency($arrestingAgency) { $this->arrestingAgency = preg_replace("/\bpd\b/i", "Police Dept",$arrestingAgency); }
public function setArrestDate($arrestDate) { $this->arrestDate = $arrestDate; }
public function setComplaintDate($complaintDate) { $this->complaintDate = $complaintDate; }
public function setJudge($judge) { $this->judge = $judge; }
public function setDispositionDate($dispositionDate) { $this->dispositionDate = $dispositionDate; }
public function setDOB($DOB) { $this->DOB = $DOB; }
public function setFirstName($firstName) { $this->firstName = $firstName; }
public function setLastName($lastName) { $this->lastName = $lastName; }
public function setCharges($charges) { $this->charges = $charges; }
public function setCostsTotal($costsTotal) { $this->costsTotal = $costsTotal; }
public function setCostsPaid($costsPaid) { $this->costsPaid = $costsPaid; }
public function setCostsCharged($costsCharged) { $this->costsCharged = $costsCharged; }
public function setCostsAdjusted($costsAdjusted) { $this->costsAdjusted = $costsAdjusted; }
public function setBailTotal($bailTotal) { $this->bailTotal = $bailTotal; }
public function setBailPaid($bailPaid) { $this->bailPaid = $bailPaid; }
public function setBailCharged($bailCharged) { $this->bailCharged = $bailCharged; }
public function setBailAdjusted($bailAdjusted) { $this->bailAdjusted = $bailAdjusted; }
public function setBailTotalTotal($bailTotal) { $this->bailTotalTotal = $bailTotal; }
public function setBailPaidTotal($bailPaid) { $this->bailPaidTotal = $bailPaid; }
public function setBailChargedTotal($bailCharged) { $this->bailChargedTotal = $bailCharged; }
public function setBailAdjustedTotal($bailAdjusted) { $this->bailAdjustedTotal = $bailAdjusted; }
public function setIsCP($isCP) { $this->isCP = $isCP; }
public function setIsCriminal($isCriminal) { $this->isCriminal = $isCriminal; }
public function setIsARDExpungement($isARDExpungement) { $this->isARDExpungement = $isARDExpungement; }
public function setIsExpungement($isExpungement) { $this->isExpungement = $isExpungement; }
public function setIsRedaction($isRedaction) { $this->isRedaction = $isRedaction; }
public function setIsSealable($isSealable) { $this->isSealable = $isSealable; }
public function setIsArrestSummaryExpungement($isSummaryExpungement) { $this->isArrestSummaryExpungement = $isSummaryExpungement; }
public function setIsArrestOver70Expungement($isOver70Expungement) { $this->isArrestOver70Expungement = $isOver70Expungement; }
public function setIsHeldForCourt($isHeldForCourt) { $this->isHeldForCourt = $isHeldForCourt; }
public function setIsOnlyHeldForCourt($isOnlyHeldForCourt) { $this->isOnlyHeldForCourt = $isOnlyHeldForCourt; }
public function setIsMDJ($isMDJ) { $this->isMDJ = $isMDJ; }
public function setIsJuvenilePhilly($isJuvenile) { $this->isJuvenilePhilly = $isJuvenile; }
public function setPDFFile($pdfFile) { $this->pdfFile = $pdfFile; }
public function setPDFFileName($pdfFileName) { $this->pdfFileName = $pdfFileName; }
public function addAlias($a) { $this->aliases[] = $a; }
// add a Bail amount to an already created bail figure
public function addBailTotal($bailTotal)
{
$this->bailTotal = $this->getBailTotal() + $bailTotal;
$this->bailTotalTotal = $this->getBailTotalTotal() + $bailTotal;
}
public function addBailPaid($bailPaid)
{
$this->bailPaid = $this->getBailPaid() + $bailPaid;
$this->bailPaidTotal = $this->getBailPaidTotal() + $bailPaid;
}
public function addBailCharged($bailCharged)
{
$this->bailCharged = $this->getBailCharged() + $bailCharged;
$this->bailChargedTotal = $this->getBailChargedTotal() + $bailCharged;
}
public function addBailAdjusted($bailAdjusted)
{
$this->bailAdjusted = $this->getBailAdjusted() + $bailAdjusted;
$this->bailAdjustedTotal = $this->getBailAdjustedTotal() + $bailAdjusted;
}
// push a single chage onto the charge array
public function addCharge($charge) { $this->charges[] = $charge; }
// @return the first docket number on the array, which should be the CP or lead docket num
public function getFirstDocketNumber()
{
if (count($this->getDocketNumber()) > 0)
{
$docketNumber = $this->getDocketNumber();
return $docketNumber[0];
}
else
return NULL;
}
// @return true if the arrestRecordFile is a docket sheet, false if it isn't
public function isDocketSheet($arrestRecordFile)
{
if (preg_match("/Docket/i", $arrestRecordFile))
return true;
else
return false;
}
// @return true if the arrestRecordFile is a docket sheet, false if it isn't
public function isMDJDocketSheet($arrestRecordFile)
{
if (preg_match("/Magisterial District Judge/i", $arrestRecordFile))
return true;
else
return false;
}
// sets isJuvenilePhilly = true if the arrest RecordFile is a Philly Juvenile Case
public function checkIsJuvenilePhilly($line)
{
if (preg_match("/Family Court of Philadelphia/i", $line))
{
$this->setIsJuvenilePhilly(TRUE);
return TRUE;
}
else
return FALSE;
}
// reads in a record and sets all of the relevant variable.
// assumes that the record is an array of lines, read through the "file" function.
// the file should be created by running pdftotext.exe on a pdf of the defendant's arrest.
// this does not read the summary.
public function readArrestRecord($arrestRecordFile, $person)
{
// check to see if this is an MDJ docket sheet. If it is, we have to
// read it a bit differently in places
if ($this->isMDJDocketSheet($arrestRecordFile[0]))
{
$this->setIsMDJ(1);
if (preg_match(self::$mdjDistrictNumberSearch, $arrestRecordFile[0], $matches))
$this->setMDJDistrictNumber(trim($matches[1]));
}
foreach ($arrestRecordFile as $line_num => $line)
{
// print "$line_num: $line<br/>";
// do all of the searches that are common to the MDJ and CP/MC docket sheets
// figure out which county we are in
if (preg_match(self::$countySearch, $line, $matches))
$this->setCounty(trim($matches[1]));
elseif (preg_match(self::$mdjCountyAndDispositionDateSearch, $line, $matches))
{
$this->setCounty(trim($matches[1]));
$this->setDispositionDate(trim(($matches[2])));
}
// find the docket Number
else if (preg_match(self::$docketSearch, $line, $matches))
{
$this->setDocketNumber(array(trim($matches[1])));
// we want to set this to be a summary offense if there is an "SU" in the
// docket number. The normal docket number looks like this:
// CP-##-CR-########-YYYY or CP-##-SU-#######-YYYYYY; the latter is a summary
// so is CP-##-SU-#######-YYYYYY, a summary appeal of a traffic offense
if (preg_match("(SU|SA)", trim($matches[3]), $dummy))
$this->setIsSummaryArrest(TRUE);
else
$this->setIsSummaryArrest(FALSE);
}
else if (preg_match(self::$mdjDocketSearch, $line, $matches))
{
$this->setDocketNumber(array(trim($matches[1])));
}
else if (preg_match(self::$OTNSearch, $line, $matches))
$this->setOTN(trim($matches[1]));
else if (preg_match(self::$DCSearch, $line, $matches))
$this->setDC(trim($matches[1]));
// find the arrest date. First check for agency and arrest date (mdj dockets). Then check for arrest date alone
else if (preg_match(self::$mdjArrestingAgencyAndArrestDateSearch, $line, $matches))
{
$this->setArrestingAgency(trim($matches[1]));
if (isset($matches[2]))
$this->setArrestDate(trim($matches[2]));
}
else if (preg_match(self::$arrestDateSearch, $line, $matches))
$this->setArrestDate(trim($matches[1]));
// find the complaint date
else if (preg_match(self::$complaintDateSearch, $line, $matches))
$this->setComplaintDate(trim($matches[1]));
// for non-mdj, aresting agency and officer are on the same line, so we have to find
// them together and deal with them together.
else if (preg_match(self::$arrestingAgencyAndOfficerSearch, $line, $matches))
{
// first set the arresting agency
$this->setArrestingAgency(trim($matches[1]));
// then deal with the arresting officer
$ao = trim($matches[2]);
// if there is no listed affiant or the affiant is "Affiant" then set arresting
// officer to "Unknown Officer"
// CHANGED 9/5/2013 to be the arresting agency if no known officer
if ($ao == "" || !(stripos("Affiant", $ao)===FALSE))
// $ao = self::$unknownOfficer;
$ao = $this->getArrestingAgency();
$this->setArrestingOfficer($ao);
}
// mdj dockets have the arresting office on a line by himself, as last name, first
else if (preg_match(self::$mdjArrestingOfficerSearch, $line, $matches))
{
$officer = trim($matches[1]);
// find the comma and switch the order of the names
$officerArray = explode(",", $officer, 2);
if (sizeof($officerArray) > 0)
$officer = trim($officerArray[1]) . " " . trim($officerArray[0]);
$this->setArrestingOfficer($officer);
}
// the judge name can appear in multiple places. Start by checking to see if the
// judge's name appears in the Judge Assigned field. If it does, then set it.
// Later on, we'll check in the "Final Issuing Authority" field. If it appears there
// and doesn't show up as "migrated," we'll reassign the judge name.
else if (preg_match(self::$judgeAssignedSearch, $line, $matches))
{
$judge = trim($matches[1]);
// check to see if this line has "magisterial district judge" in it. If it does,
// lop off that phrase and then check the next line to see if anything important is on it
if (preg_match(self::$magisterialDistrictJudgeSearch, $judge, $judgeMatch))
{
// first catch the judge
$judge = trim($judgeMatch[1]);
// then check the next line to see if there is anything of interest
$i = $line_num+1;
if (preg_match(self::$judgeSearchOverflow, $arrestRecordFile[$i], $judgeOverflowMatch))
$judge .= " " . trim($judgeOverflowMatch[1]);
}
if (!preg_match(self::$migratedJudgeSearch, $judge, $junk))
$this->setJudge($judge);
// if this is an mdj docket, the complaint date will also be on this same line, so we want to search for that as well
if (preg_match(self::$mdjComplaintDateSearch, $line, $matches))
$this->setComplaintDate(trim($matches[1]));
}
else if (preg_match(self::$judgeSearch, $line, $matches))
{
// make sure the judge field isn't blank or doesn't equal "migrated"
if (!preg_match(self::$migratedJudgeSearch, $matches[1], $junk) && trim($matches[1]) != "")
$this->setJudge(trim($matches[1]));
}
else if (preg_match(self::$DOBSearch, $line, $matches))
$this->setDOB(trim($matches[1]));
else if (preg_match(self::$nameSearch, $line, $matches))
{
$this->setFirstName(trim($matches[2]));
$this->setLastName(trim($matches[1]));
// we also want to add all of the names that are on the docket sheets to the alias list.
$person->addAliases(array($this->getLastName() . ", " . $this->getFirstName()));
}
else if (preg_match(self::$dispDateSearch, $line, $matches))
$this->setDispositionDate($matches[1]);
// find aliases. Only try to do so if we haven't looked for aliases previously.
else if (!$this->pastAliases && preg_match(self::$aliasNameStartSearch, $line))
{
$i = $line_num+1;
while (!preg_match(self::$aliasNameEndSearch, $arrestRecordFile[$i]))
{
// once in a while, the aliases are at the end of a page, which means we get to the footer information
// before we get to the regular marker of the end of the aliases. We have to watch out for this
// and break if we find it
if (preg_match(self::$endOfPageSearch, $arrestRecordFile[$i]))
break;
// parse out the name from the rest of the alias and then push the alias onto the array of aliases
if (preg_match("/\w/", $arrestRecordFile[$i]))
{
// first parse out the name from the rest of the alias
// The name can be in two forms: one form is just the name on a line; the other is the name, followed by the SSN and SID.
$aliasName = explode(" ", trim($arrestRecordFile[$i]),2);
// then push this onto the alias array
$this->addAlias(trim($aliasName[0]));
}
$i++;
}
// once we match the CASE PARTICIPANTS line, we know we are done with this iteration
$this->pastAliases = TRUE;
// set the aliases on the person object
$person->addAliases($this->getAliases());
}
// charges can be spread over two lines sometimes; we need to watch out for that
else if (preg_match(self::$chargesSearch2, $line, $matches))
{
// ignore this charge if it is in the exclusion array
if (in_array(trim($matches[2]), self::$ignoreDisps))
continue;
$charge = trim($matches[1]);
// we need to check to see if the next line has overflow from the charge.
// this happens on long charges, like possession of controlled substance
$i = $line_num+1;
if (preg_match(self::$chargesSearchOverflow, $arrestRecordFile[$i], $chargeMatch))
{
$charge .= " " . trim($chargeMatch[1]);
$i++;
}
// also, knock out any strange multiple space situations in the charge, which comes up sometimes.
$charge = preg_replace("/\s{2,}/", " ", $charge);
// need to grab the disposition date as well, which is on the next line
if (isset($this->dispositionDate))
$dispositionDate = $this->getDispositionDate();
else if (preg_match(self::$dispDateSearch2, $arrestRecordFile[$i], $dispMatch))
// set the date;
$dispositionDate = $dispMatch[2];
else
$dispositionDate = NULL;
$charge = new Charge($charge, $matches[2], trim($matches[4]), trim($dispositionDate), trim($matches[3]));
$this->addCharge($charge);
}
// match a charge for MDJ
else if ($this->getIsMDJ() && preg_match(self::$mdjChargesSearch, $line, $matches))
{
$charge = trim($matches[4]);
// we need to check to see if the next line has overflow from the charge.
// this happens on long charges, like possession of controlled substance
$i = $line_num+1;
if (preg_match(self::$chargesSearchOverflow, $arrestRecordFile[$i], $chargeMatch))
{
$charge .= " " . trim($chargeMatch[1]);
$i++;
}
// add the charge to the charge array
if (isset($this->dispositionDate))
$dispositionDate = $this->getDispositionDate();
else
$dispositionDate = NULL;
$charge = new Charge($charge, trim($matches[6]), trim($matches[1]), trim($dispositionDate), trim($matches[3]));
$this->addCharge($charge);
}
else if (preg_match(self::$bailSearch, $line, $matches))
{
$this->addBailCharged(doubleval(str_replace(",","",$matches[1])));
$this->addBailPaid(doubleval(str_replace(",","",$matches[2]))); // the amount paid
$this->addBailAdjusted(doubleval(str_replace(",","",$matches[3])));
$this->addBailTotal(doubleval(str_replace(",","",$matches[5]))); // tot final amount, after all adjustments
}
else if (preg_match(self::$costsSearch, $line, $matches))
{
$this->setCostsCharged(doubleval(str_replace(",","",$matches[1])));
$this->setCostsPaid(doubleval(str_replace(",","",$matches[2]))); // the amount paid
$this->setCostsAdjusted(doubleval(str_replace(",","",$matches[3])));
$this->setCostsTotal(doubleval(str_replace(",","",$matches[5]))); // tot final amount, after all adjustments
}
// search for things that only have to do with juvenile cases in philly
else if ($this->isJuvenilePhilly && preg_match(self::$juvenileNumberSearch, $line, $matches))
$this->setJNumber(trim($matches[1]));
else if ($this->isJuvenilePhilly && preg_match(self::$SIDSearch, $line, $matches))
$this->setSID(trim($matches[1]));
else if ($this->isJuvenilePhilly && preg_match(self::$PIDSearch, $line, $matches))
$this->setPID(trim($matches[1]));
else if ($this->isJuvenilePhilly && preg_match(self::$juvenileNameSearch, $line, $matches))
{
list($first,$last) = explode(" ", trim($matches[1]),2);
$this->setFirstName($first);
$this->setLastName($last);
}
// this is sort of a funny one. the very last bare date entry in the docket is the date
// that the case was discharged. It is on a line by itself and there isn't any
// consistent context around the date that could be used to find this final date entry.
// So rather than search for it, I am going to search for EVERY bare date entry and store
// each as the discharge date. The final one will override all previous and we will have a
// discharge date!
else if ($this->isJuvenilePhilly && preg_match(self::$dischargeDateSearch, trim($line), $matches))
$this->setJDischargeDate(trim($matches[1]));
}
}
// Compares two arrests to see if they are part of the same case. Two arrests are part of the
// same case if the DC or OTNs match; first check DC, then check OTN.
// There are some cases where the OTNs match, but not the DC. This can happen when:
// someone is arrest and charged with multiple sets of crimes; all of these cases go to CP court
// but they aren't consolidated. B/c the arrests happened at the same time, OTN will
// be the same on all cases, but the DC numbers will only match from the MC to the CP that
// follows
// Don't match true if we match ourself
public function compare($that)
{
// return false if we match ourself
if ($this->getFirstDocketNumber() == $that->getFirstDocketNumber())
return FALSE;
else if ($this->getDC() != self::$unknownInfo && $this->getDC() == $that->getDC())
return TRUE;
else if ($this->getDC() == self::$unknownInfo && ($this->getOTN() != self::$unknownInfo && $this->getOTN() == $that->getOTN()))
return TRUE;
else
return FALSE;
}
// combines the $this and $that. We assume for the purposes of this function that
// $this and $that are the same docket number as that was previously checked
// @param $that is an Arrest, but obtained from the Summary docket sheet, so it doesn't
// have charge information with, just judge, arrest date, etc...
public function combineWithSummary($that)
{
if (!empty($that->getJudge()))
$this->setJudge($that->getJudge());
if (!isset($this->arrestDate) || $this->getArrestDate() == self::$unknownInfo)
$this->setArrestDate($that->getArrestDate());
if (!isset($this->dispositionDate) || $this->getDispositionDate() == self::$unknownInfo)
$this->setDispositionDate($that->getDispositionDate());
}
//gets the first docket number on the array
// Compares $this arrest to $that arrest and determines if they are actually part of the same
// case. Two arrests are part of the same case if they have the same OTN or DC number.
// If the two arrests are part of the same case, combines them by taking all of the information
// from one case and adding it to the other case (unless that information is already there.
// It is important to note that you can only combine a CP case with an MC case. You cannot
// two MC cases together without a CP.
// @param $that = Arrest to combine with $this
public function combine($that)
{
// if $this isn't a CP case, then don't combine. If $that is a CP case, don't combine.
if (!$this->isCP() || $that->isCP())
{
return FALSE;
}
// return false if we don't find something with the same DC or OTN number
if (!$this->compare($that))
return FALSE;
// if $that (the MC case) is an expungement itself, then we don't want to combine.
// If the MC case was an expungement, then no charges will move up from the MC case
// to the associated CP case. This happens in the following situation:
// Person is arrested and charged with three different sets of crimes that show up on
// 3 different MC cases. One of the MC cases is completely resolved at the prelim hearing
// and charges are dismissed. The other two MC cases have "held for court" charges
// which are brought up to a CP case. THe CP case OTN will match all three MC cases, but
// will only have charges from the two MC cases that were "held for court"
if ($that->isArrestExpungement())
return FALSE;
// combine docket numbers
$this->setDocketNumber(array_merge($this->getDocketNumber(),$that->getDocketNumber()));
// combine charges. Only include $that charges that are not "held for court"
// The reason for this is that held for court charges will already appear on the CP,
// they will just appear with a disposition. We don't want to include held for court
// charges and then assume that this isn't an expungement in our later logic.
// This is a possible future thing to change. Perhaps held for court should be put on
// And something should be "expungeable" regardless of whether "held for court"
// charges are on there.
$thatChargesNoHeldForCourt = array();
foreach ($that->charges as $charge)
{
$thatDisp = $charge->getDisposition();
// note strange use of strpos. strpos returns the location of the first occurrence of the string
// or boolean false. you have to check with === FALSE b/c the first occurence of the strong could
// be position 0 or 1, which would otherwise evaluate to true and false!
if (strpos($thatDisp, "Held for Court")===FALSE && strpos($thatDisp, "Waived for Court")===FALSE)
$thatChargesNoHeldForCourt[] = $charge;
}
// if $thatChargesNoHeldForCourt[] has less elements than $that->charges, we know that
// some charges were disposed of at the lower court level. In that case, we need to
// add the lower court judges in as well on the expungement sheet.
// @todo add judges here
$this->setCharges(array_merge($this->getCharges(),$thatChargesNoHeldForCourt));
// combine bail amounts. This isn't used for the petitions, but it is helpful for later
// when we print out the overview of bail.
// Generally speaking, an individual could have a bail assessment on an MC case, even if
// all charged went to CP court (this would happen if they failed to appear for a hearing
// and then later appeared, were sent to CP court, and were tried there.
// generally speaking, there are not fines on an MC case that is ultimately combined with
// a CP case.
$this->setBailChargedTotal($this->getBailChargedTotal()+$that->getBailChargedTotal());
$this->setBailTotalTotal($this->getBailTotalTotal()+$that->getBailTotalTotal());
$this->setBailAdjustedTotal($this->getBailAdjustedTotal()+$that->getBailAdjustedTotal());
$this->setBailPaidTotal($this->getBailPaidTotal()+$that->getBailPaidTotal());
// set MDJ as "2" if that is an an mdj. "2" means that this is a case descending from MDJ
// also set the mdj number
if ($that->getIsMDJ())
{
$this->setIsMDJ(2);
$this->setMDJDistrictNumber($that->getMDJDistrictNumber());
}
return TRUE;
}
// @return a comma separated list of all of the dispositions that are on the "charges" array
// @param if redactableOnly is true (default) returns only redactable offenses
public function getDispList($redactableOnly=TRUE)
{
$disposition = "";
foreach ($this->getCharges() as $charge)
{
// if we are only looking for redactable charges, skip this charge if it isn't redactable
if ($redactableOnly && !$charge->isRedactable())
continue;
if ((stripos($disposition,$charge->getDisposition())===FALSE))
{
if ($disposition != "")
$disposition .= ", ";
$disposition .= $charge->getDisposition();
}
}
return $disposition;
}
// @param redactableOnly - boolean defaults to false; if set to true, only returns redactable charges
// @return a string holding a comma separated list of charges that are in the charges array;
// @return if "redactableOnly" is TRUE, returns only those charges that are expungeable
public function getChargeList($redactableOnly=FALSE)
{
$chargeList = "";
foreach ($this->getCharges() as $charge)
{
// if we are trying to only get the list of "Expungeable" offenses, then
// continue to the next charge if this charge is not Expungeable
if ($redactableOnly && !$charge->isRedactable())
continue;
if ($chargeList != "")
$chargeList .= ", ";
$chargeList .= ucwords(strtolower($charge->getChargeName()));
}
return $chargeList;
}
// returns the age based off of the DOB read from the arrest record
public function getAge()
{
$birth = new DateTime($this->getDOB());
$today = new DateTime();
return dateDifference($today, $birth);
}
// @return the disposition date of the first charge on the charges array
// @return if no disposition date exists on the first chage, then sets the dipsositionDate to the migrated disposition date
public function getDispositionDate()
{
if (!isset($this->dispositionDate))
{
if (count($this->charges))
{
$firstCharge = $this->getCharges();
$this->setDispositionDate($firstCharge[0]->getDispDate());
}
else
$this->setDispositionDate(self::$unknownInfo);
}
return $this->dispositionDate;
}
// @function getBestDispotiionDate returns a dispotition date if available. Otherwise returns
// the arrest date.
// @return a date
public function getBestDispositionDate()
{
if ($this->getDispositionDate() != self::$unknownInfo)
return $this->getDispositionDate();
else
return $this->getArrestDate();
}
// returns true if this is a criminal offense. this is true if we see CP|MC-##-CR|SU,
// not SA or MD
public function isArrestCriminal()
{
if (isset($this->isCriminal))
return $this->getIsCriminal();
else
{
$criminalMatch = "/CR|SU|SA|MJ|JV|MD/";
if (preg_match($criminalMatch, $this->getFirstDocketNumber()))
{
$this->setIsCriminal(TRUE);
return TRUE;
}
$this->setIsExpungement(FALSE);
return FALSE;
}
}
// returns true if this arrest includes ARD offenses.
public function isArrestARDExpungement()
{
if (isset($this->isARDExpungement))
return $this->getIsARDExpungement();
else
{
foreach ($this->getCharges() as $num=>$charge)
{
if($charge->isARD())
{
$this->setIsARDExpungement(TRUE);
return TRUE;
}
}
$this->setIsARDExpungement(FALSE);
return FALSE;
}
}
// @function isArrestOver70Expungement() - returns true if the petition is > 70yo and they have been arrest
// free for at least the last 10 years.
// @param arrests - an array of all of the other arrests that we are comparing this to to see if they are
// 10 years arrest free
//@ return TRUE if the conditions above are me; FALSE if not
public function isArrestOver70Expungement($arrests, $person)
{
// if already set, then just return the member variable
if (isset($this->isArrestOver70Expungement))
return $this->isArrestOver70Expungement;
// return false right away if the petition is younger than 70
if ($person->getAge() < 70)
{
$this->setIsArrestOver70Expungement(FALSE);
return FALSE;
}
// also return false right away if there aren't any charges to actually look at
if (count($this->getCharges())==0)
{
$this->setIsArrestOver70Expungement(FALSE);
return FALSE;
}
// do an over 70 exp if at least one is not redactible; if this is a regular exp, just do a regular exp
// NOTE: THis may be a problem for HELD FOR COURT charges; keep this in mind
if ($this->isArrestExpungement())
{
$this->setIsArrestOver70Expungement(FALSE);
return FALSE;
}
// at this point we know two things: we are over 70 and we need to get non-redactable charges off of
// the record
// Loop through all of the arrests passed in to get the disposition dates or the
// arrest dates if the disposition dates don't exist.
// return false if any of them are within 10 years of today
$dispDates = array();
$dispDates[] = new DateTime($this->getBestDispositionDate());
foreach ($arrests as $arrest)
{
$dispDates[] = new DateTime($arrest->getBestDispositionDate());
}
// look at each dispDate in the array and make sure it was more than 10 years ago
$today = new DateTime();
foreach ($dispDates as $dispDate)
{
if (abs(dateDifference($dispDate, $today)) < 10)
{
$this->setIsArrestOver70Expungement(FALSE);
return FALSE;
}
}
// if we got here, it means there are no five year periods of freedom
$this->setIsArrestOver70Expungement(TRUE);
return TRUE;
}
// returns true if any charges on this case ended in conviction
function isArrestConviction()
{
if (isset($this->isArrestConviction))
return $this->isArrestConviction;
else
{
foreach ($this->getCharges() as $charge)
{
if ($charge->isConviction())
{
$this->isArrestConviction = true;
return true;
}
}
return false;
}
}
// @function isArrestSummaryExpungement - returns true if this is an expungeable summary
// arrest.
// This is true in a slightly more complicated sitaution than the others. To be a
// summary expungement a few things have to be true:
// 1) This has to be a summary offense, characterized by "SU" in the docket number.
// 2) The person must have been found guilty or plead guilty to the charges (if they were
// not guilty or dismissed, then there is nothing to worry about - normal expungmenet.
// 3) The person must have five years arrest free at any time AFTER the arrest.
// Previously, Commonwealth v. Giulian (Super. Ct. 2015) found that only the 5 years immediately
// the following conviction matters, but the PA SCt reversed that in July 2016.
// @note - a problem that might come up is if someone has a summary and then is confined in jail
// for a long period of time (say 10 years). This will apear eligible for a summary exp, but
// is not.
// @param arrests - an array of all of the other arrests that we are comparing this too to see
// if they are 5 years arrest free
// @return TRUE if the conditions above are met; FALSE if not.
public function isArrestSummaryExpungement($arrests)
{
// if already set, then just return the member variable
if (isset($this->isArrestSummaryExpungement))