| 1 | <?php |
||
| 19 | class ErroneousMessagesSelector |
||
| 20 | { |
||
| 21 | /** |
||
| 22 | * @var string |
||
| 23 | */ |
||
| 24 | protected $class; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @var ManagerRegistry |
||
| 28 | */ |
||
| 29 | protected $registry; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @param string $class |
||
| 33 | */ |
||
| 34 | public function __construct(ManagerRegistry $registry, $class) |
||
| 35 | { |
||
| 36 | $this->registry = $registry; |
||
| 37 | $this->class = $class; |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Retrieve messages with given type(s) and restrict to max attempts count. |
||
| 42 | * |
||
| 43 | * @param int $maxAttempts |
||
| 44 | * |
||
| 45 | * @return array |
||
| 46 | */ |
||
| 47 | public function getMessages(array $types, $maxAttempts = 5) |
||
| 68 | } |
||
| 69 |