2016-07-19 09:27:35 +00:00
|
|
|
<?php
|
|
|
|
|
2016-10-18 14:03:03 +00:00
|
|
|
namespace database\repo;
|
2016-11-05 13:57:35 +00:00
|
|
|
use \database\core\DatabaseDriver;
|
2016-10-18 14:03:03 +00:00
|
|
|
use \database\core\Repo;
|
2016-07-19 09:27:35 +00:00
|
|
|
use \manager\repo\cluster as clusterRepo;
|
2017-09-25 21:21:42 +00:00
|
|
|
use \orm\core\Table;
|
2016-07-19 09:27:35 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
*
|
2017-09-24 17:47:00 +00:00
|
|
|
* @return states<Array> Retourne les données sous forme de tableau de la forme (state, chip, pin, value)
|
2016-07-19 09:27:35 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
public static function getForChip($id_chip){
|
|
|
|
|
2017-09-24 17:47:00 +00:00
|
|
|
$chip = Table::get('chip')
|
|
|
|
->select('id_chip')
|
|
|
|
->whereId($id_chip);
|
2016-07-19 09:27:35 +00:00
|
|
|
|
2017-09-24 17:47:00 +00:00
|
|
|
$req = Table::get('state')
|
|
|
|
->select('state')
|
|
|
|
->select('value')
|
|
|
|
->join('id_chip', $chip);
|
2016-07-19 09:27:35 +00:00
|
|
|
|
2017-09-24 17:47:00 +00:00
|
|
|
return $req->fetch();
|
2016-07-19 09:27:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
?>
|