51 lines
1.0 KiB
PHP
51 lines
1.0 KiB
PHP
|
<?php
|
||
|
|
||
|
namespace manager\repo;
|
||
|
use \manager\Database;
|
||
|
|
||
|
class token{
|
||
|
|
||
|
/* Gestion de la table Token (pour secu) et des derivations
|
||
|
*
|
||
|
* 1. Gestion des access
|
||
|
* - getById(id_token)
|
||
|
* - getAll()
|
||
|
*
|
||
|
* 2. Gestion de la verification
|
||
|
* - check(token, id_personne)
|
||
|
*
|
||
|
* 3. Gestion de la
|
||
|
* - merge(idA, idB)
|
||
|
*
|
||
|
* 4. Gestion de creation
|
||
|
* - create(pseudo, nom, prenom, facebook, telephone)
|
||
|
*
|
||
|
*
|
||
|
*/
|
||
|
|
||
|
|
||
|
/* RETOURNE LA LISTE DE TOUS LES TOKENS
|
||
|
*
|
||
|
* @return tokens<Array> Liste de tous les tokens
|
||
|
*
|
||
|
*/
|
||
|
public static function getAll(){
|
||
|
/* [1] On prepare et execute la requete
|
||
|
=========================================================*/
|
||
|
$request = Database::getPDO()->query("SELECT id_token as id, name, token, creation, expires
|
||
|
FROM api_token
|
||
|
ORDER BY creation ASC");
|
||
|
|
||
|
/* [2] On recupere et retourne les donnees
|
||
|
=========================================================*/
|
||
|
return Database::delNumeric( $request->fetchAll() );
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
?>
|