DeviceService
extends AirlayService
in package
Class DeviceService
Table of Contents
- $ : AirlayConfig
- $collection : DevicesCollection
- $rabbitmq : AMQPStreamConnection
- $user : UserEntity
- $collection : mixed
- __construct() : mixed
- aggregateDeviceUsers() : array<string|int, mixed>
- create() : DeviceEntity
- createPushApiData() : array<string|int, mixed>
- getCollection() : mixed
- getUserAttributes() : array<string|int, mixed>
- getUserDevicesFromDepartmentBrigades() : array<string|int, DeviceEntity>
- sendMessage() : array<string|int, FeatureEntity>
- setUserAttributes() : void
- updateAttributes() : void
Properties
$
public
AirlayConfig
$
config
$collection
public
DevicesCollection
$collection
$rabbitmq
public
AMQPStreamConnection
$rabbitmq
$user
public
UserEntity
$user
$collection
protected
mixed
$collection
Methods
__construct()
public
__construct(mixed $collection) : mixed
Parameters
- $collection : mixed
Return values
mixed —aggregateDeviceUsers()
public
aggregateDeviceUsers(array<string|int, mixed> $devices) : array<string|int, mixed>
Parameters
- $devices : array<string|int, mixed>
Return values
array<string|int, mixed> —create()
public
create(string $deviceId, UserEntity $user) : DeviceEntity
Parameters
- $deviceId : string
- $user : UserEntity
Return values
DeviceEntity —createPushApiData()
public
createPushApiData(DeviceEntity $device, FeatureEntity $feature, string $message) : array<string|int, mixed>
Parameters
- $device : DeviceEntity
- $feature : FeatureEntity
- $message : string
Return values
array<string|int, mixed> —getCollection()
public
getCollection() : mixed
Return values
mixed —getUserAttributes()
public
getUserAttributes(UserEntity $user) : array<string|int, mixed>
Parameters
- $user : UserEntity
Return values
array<string|int, mixed> —getUserDevicesFromDepartmentBrigades()
public
getUserDevicesFromDepartmentBrigades(ObjectId $departmentId) : array<string|int, DeviceEntity>
Parameters
- $departmentId : ObjectId
Return values
array<string|int, DeviceEntity> —sendMessage()
public
sendMessage(array<string|int, DeviceEntity> $devices, string $message, UserEntity $sender) : array<string|int, FeatureEntity>
Parameters
- $devices : array<string|int, DeviceEntity>
- $message : string
- $sender : UserEntity
Return values
array<string|int, FeatureEntity> —setUserAttributes()
public
setUserAttributes(DeviceEntity $device, UserEntity $user) : void
Parameters
- $device : DeviceEntity
- $user : UserEntity
Return values
void —updateAttributes()
public
updateAttributes(string $deviceId, UserEntity $user) : void
Parameters
- $deviceId : string
- $user : UserEntity