60 lines
1.2 KiB
PHP
60 lines
1.2 KiB
PHP
<?php
|
|
/**
|
|
* Created by PhpStorm.
|
|
* User: lucas
|
|
* Date: 27/02/18
|
|
* Time: 17:31
|
|
*/
|
|
|
|
namespace api\module;
|
|
|
|
|
|
use database\core\Repo;
|
|
|
|
class formationController
|
|
{
|
|
|
|
public function get($args){
|
|
$form_id = null;
|
|
extract($args);
|
|
|
|
/** @var \database\repo\formation $repo */
|
|
$repo = Repo::getRepo("formation");
|
|
|
|
return ['formations' => $repo->get($form_id)];
|
|
}
|
|
|
|
public function post($args){
|
|
$label = null;
|
|
$isInternal = null;
|
|
extract($args);
|
|
|
|
/** @var \database\repo\formation $repo */
|
|
$repo = Repo::getRepo("formation");
|
|
|
|
return ['idFormation' => $repo->create($label,$isInternal)];
|
|
}
|
|
|
|
public function put($args){
|
|
$idFormation = null;
|
|
$label = null;
|
|
$isInternal = null;
|
|
extract($args);
|
|
|
|
/** @var \database\repo\formation $repo */
|
|
$repo = Repo::getRepo("formation");
|
|
|
|
return ['success' => $repo->update($idFormation,$label,$isInternal)];
|
|
}
|
|
|
|
public function delete($args){
|
|
$idFormation = null;
|
|
extract($args);
|
|
|
|
/** @var \database\repo\formation $repo */
|
|
$repo = Repo::getRepo("formation");
|
|
|
|
return ['success' => $repo->delete($idFormation)];
|
|
}
|
|
|
|
} |