| Total Complexity | 4 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Coverage | 42.86% |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class AgentParticipants extends Collection |
||
| 10 | { |
||
| 11 | public $metaData; |
||
| 12 | |||
| 13 | 1 | public function __construct(array $models = []) |
|
| 14 | { |
||
| 15 | |||
| 16 | $models = array_map(function($item) { |
||
| 17 | 1 | return is_a($item, 'LivePersonInc\LiveEngageLaravel\Models\Agent') ? $item : new Agent((array) $item); |
|
| 18 | 1 | }, $models); |
|
| 19 | 1 | $this->metaData = new MetaData(); |
|
| 20 | 1 | parent::__construct($models); |
|
| 21 | 1 | } |
|
| 22 | |||
| 23 | public function state($state = 'ONLINE') |
||
| 24 | { |
||
| 25 | $result = $this->filter(function($value) use ($state) { |
||
| 26 | return strtolower($value->currentStatus) == strtolower($state); |
||
| 27 | }); |
||
| 28 | |||
| 29 | return $result; |
||
| 30 | } |
||
| 31 | |||
| 32 | public function findById($agentId) |
||
| 39 | } |
||
| 40 | } |
||
| 41 |