| Total Complexity | 4 |
| Total Lines | 57 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 19 | class AgentParticipants extends Collection |
||
| 20 | { |
||
| 21 | /** |
||
| 22 | * metaData |
||
| 23 | * |
||
| 24 | * @var \LivePersonInc\LiveEngageLaravel\Models\MetaData |
||
| 25 | * @access public |
||
| 26 | */ |
||
| 27 | public $metaData; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * __construct function. |
||
| 31 | * |
||
| 32 | * @access public |
||
| 33 | * @param array $models (default: []) |
||
| 34 | * @return void |
||
| 35 | */ |
||
| 36 | 2 | public function __construct(array $models = []) |
|
| 44 | 2 | } |
|
| 45 | |||
| 46 | /** |
||
| 47 | * state function returns any agents in the collection with the specified availability state. |
||
| 48 | * |
||
| 49 | * @access public |
||
| 50 | * @param string $state (default: 'ONLINE') |
||
| 51 | * @return \LivePersonInc\LiveEngageLaravel\Models\Agent |
||
| 52 | */ |
||
| 53 | 1 | public function state($state = 'ONLINE') |
|
| 54 | { |
||
| 55 | $result = $this->filter(function($value) use ($state) { |
||
| 56 | 1 | return strtolower($value->currentStatus) == strtolower($state); |
|
| 57 | 1 | }); |
|
| 58 | |||
| 59 | 1 | return $result; |
|
|
|
|||
| 60 | } |
||
| 61 | |||
| 62 | /** |
||
| 63 | * findById function. |
||
| 64 | * |
||
| 65 | * @access public |
||
| 66 | * @param int $agentId |
||
| 67 | * @return \LivePersonInc\LiveEngageLaravel\Models\Agent |
||
| 68 | */ |
||
| 69 | 2 | public function findById($agentId) |
|
| 76 | } |
||
| 77 | } |
||
| 78 |