2019-01-15 15:46:24 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace AirQuality\Repositories;
|
|
|
|
|
2019-06-21 21:05:13 +00:00
|
|
|
/**
|
|
|
|
* Defines the interface of repositories that fetch device information.
|
|
|
|
*/
|
2019-01-15 15:46:24 +00:00
|
|
|
interface IDeviceRepository {
|
2019-01-17 15:39:50 +00:00
|
|
|
/**
|
|
|
|
* Returns an array of all the devices in the system with basic information
|
|
|
|
* about each.
|
|
|
|
* @param bool $only_with_location Whether only devices with a defined location should be returned.
|
|
|
|
* @return array A list of devices and their basic information.
|
|
|
|
*/
|
|
|
|
public function get_all_devices($only_with_location);
|
2019-01-18 21:49:14 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets a bunch of information about a device.
|
|
|
|
* This method returns _considerably_ more information than the above one
|
|
|
|
* that lists a bunch of devices, but only works for 1 device at a time.
|
|
|
|
* @param int $device_id The id of the device to get information for.
|
|
|
|
* @return array The extended information available on the given device.
|
|
|
|
*/
|
|
|
|
public function get_device_info_ext($device_id);
|
2019-06-21 21:05:13 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets a list of devices that are near the specified location.
|
|
|
|
* @param float $lat The latitude of the location to get devices near.
|
|
|
|
* @param float $long The longitude of the location to get devices near.
|
|
|
|
* @param int $count The number of nearby devices to return.
|
|
|
|
* @return array An array of nearby devices.
|
|
|
|
*/
|
|
|
|
public function get_near_location(float $lat, float $long, int $count);
|
2019-01-15 15:46:24 +00:00
|
|
|
}
|