Lines
100.00%
5 / 5
Functions and Methods
100.00%
1 / 1
Classes and Traits
100.00%
1 / 1
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| MailList | 100.00% | 5 / 5 | 100.00% | 1 / 1 | 3 | 100.00% | 1 / 1 | |||
| withProcess | 100.00% | 5 / 5 | 100.00% | 1 / 1 | 3 | |||||
| 1 | <?php | |
| 2 | ||
| 3 | namespace BO\Zmsentities\Collection; | |
| 4 | ||
| 5 | /** | |
| 6 | * @extends Base<\BO\Zmsentities\Mail> | |
| 7 | */ | |
| 8 | class MailList extends Base | |
| 9 | { | |
| 10 | public const string ENTITY_CLASS = '\BO\Zmsentities\Mail'; | |
| 11 | ||
| 12 | public function withProcess(mixed $processId): self | |
| 13 | { | |
| 14 | $list = new self(); | |
| 15 | foreach ($this as $mail) { | |
| 16 | if ($mail->getProcessId() == $processId) { | |
| 17 | $list[] = clone $mail; | |
| 18 | } | |
| 19 | } | |
| 20 | return $list; | |
| 21 | } | |
| 22 | } |