38 lines
803 B
PHP
Executable File
38 lines
803 B
PHP
Executable File
<?php
|
|
|
|
namespace database\repo;
|
|
use \database\core\DatabaseDriver;
|
|
use \database\core\Repo;
|
|
use \manager\repo\cluster as clusterRepo;
|
|
|
|
class state extends parentRepo{
|
|
|
|
protected static function table_name(){ static $table_name = 'state'; return $table_name; }
|
|
|
|
|
|
/* RETOURNE LES VALEURS DE CHAQUE PIN POUR CHAQUE ETAT POUR UNE PUCE EN PARTICULIER
|
|
*
|
|
* @id_chip<int> UID de la puce
|
|
*
|
|
* @return states<Array> Retourne les données sous forme de tableau de la forme (state, chip, pin, value)
|
|
*
|
|
*/
|
|
public static function getForChip($id_chip){
|
|
|
|
$chip = Table::get('chip')
|
|
->select('id_chip')
|
|
->whereId($id_chip);
|
|
|
|
$req = Table::get('state')
|
|
->select('state')
|
|
->select('value')
|
|
->join('id_chip', $chip);
|
|
|
|
return $req->fetch();
|
|
}
|
|
|
|
}
|
|
|
|
|
|
?>
|