2019-01-14 21:43:45 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace AirQuality\Repositories;
|
|
|
|
|
|
|
|
interface IMeasurementTypeRepository {
|
2019-01-15 15:46:24 +00:00
|
|
|
/**
|
|
|
|
* Returns whether the specified type is valid or not.
|
2019-02-18 20:39:35 +00:00
|
|
|
* @param string $id The id of the type to validate.
|
2019-01-15 17:02:24 +00:00
|
|
|
* @return bool Whether the specified type name is valid or not.
|
2019-01-15 15:46:24 +00:00
|
|
|
*/
|
2019-02-18 20:39:35 +00:00
|
|
|
public function is_valid_type(int $id) : bool;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the id associated with the given short description.
|
|
|
|
* @param string $short_descr The short description to convert.
|
2019-02-20 17:39:45 +00:00
|
|
|
* @return int|null The id associated with the specified short description.
|
2019-02-18 20:39:35 +00:00
|
|
|
*/
|
2019-02-20 17:39:45 +00:00
|
|
|
public function get_id(string $short_descr);
|
2019-01-15 15:46:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the friendly name for the specified type name.
|
2019-02-18 20:39:35 +00:00
|
|
|
* @param int $id The measurement type id to get the friendly name for.
|
2019-01-15 15:46:24 +00:00
|
|
|
* @return string The friendly name for the specified type name.
|
|
|
|
*/
|
2019-02-18 20:39:35 +00:00
|
|
|
public function get_friendly_name(int $id) : string;
|
2019-01-15 15:46:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns all the currently known meeasurement types.
|
|
|
|
* @return array All the measurement types currently known.
|
|
|
|
*/
|
2019-01-14 21:43:45 +00:00
|
|
|
public function get_all_types();
|
2019-02-07 19:15:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the all the measurement types ever reported by a given device id.
|
2019-11-07 18:43:28 +00:00
|
|
|
* @param int $device_id The id of the device to get the reading types for.
|
2019-02-07 19:15:38 +00:00
|
|
|
* @return string[] A list of device ids.
|
|
|
|
*/
|
2021-01-30 18:26:50 +00:00
|
|
|
public function get_types_by_device(int $device_id);
|
2019-01-14 21:43:45 +00:00
|
|
|
}
|