[xdrm-framework] update: now implementations have 'Controller' as a suffix for the class name.

This commit is contained in:
xdrm-brackets 2018-03-01 17:21:48 +01:00
parent caafc646a8
commit ffdc0bd15e
8 changed files with 34 additions and 11 deletions

View File

@ -35,11 +35,11 @@
$module_ns = str_replace('/', '\\', $module); $module_ns = str_replace('/', '\\', $module);
/* (4) On vérifie que la classe existe */ /* (4) On vérifie que la classe existe */
if( !file_exists(__BUILD__."/api/module$module.php") ) if( !file_exists(__BUILD__."/api/module${module}Controller.php") )
return false; return false;
/* (5) On récupère la classe */ /* (5) On récupère la classe */
$class_name = "\\api\\module$module_ns"; $class_name = "\\api\\module${module_ns}Controller";
/* (6) On retourne une instance */ /* (6) On retourne une instance */
return new $class_name($arguments); return new $class_name($arguments);

View File

@ -11,7 +11,7 @@ namespace api\module;
use database\core\Repo; use database\core\Repo;
class Category class CategoryController
{ {
public function get($args){ public function get($args){

View File

@ -21,7 +21,7 @@ use error\core\Err;
use error\core\Error; use error\core\Error;
use PhpOffice\PhpSpreadsheet\Exception; use PhpOffice\PhpSpreadsheet\Exception;
class Excel class ExcelController
{ {
private const startLineUE = 5; private const startLineUE = 5;
@ -138,7 +138,7 @@ class Excel
//starting the iteration //starting the iteration
foreach($UESpreadsheet->getRowIterator() as $row){ foreach($UESpreadsheet->getRowIterator() as $row){
//skip the first rows //skip the first rows
if($row->getRowIndex() < Excel::startLineUE) continue; if($row->getRowIndex() < self::startLineUE) continue;
$firstCellValue = ($UESpreadsheet->getCellByColumnAndRow(1,$row->getRowIndex()) ?? $exitWithNullException())->getValue(); $firstCellValue = ($UESpreadsheet->getCellByColumnAndRow(1,$row->getRowIndex()) ?? $exitWithNullException())->getValue();
@ -260,7 +260,7 @@ class Excel
foreach($ProfSpreadshit->getRowIterator() as $row){ foreach($ProfSpreadshit->getRowIterator() as $row){
//skip the first lines //skip the first lines
if($row->getRowIndex() < Excel::startLineProf) continue; if($row->getRowIndex() < self::startLineProf) continue;
$firstCellValue = ($ProfSpreadshit->getCellByColumnAndRow(2,$row->getRowIndex()) ?? $exitWithNullException())->getValue(); $firstCellValue = ($ProfSpreadshit->getCellByColumnAndRow(2,$row->getRowIndex()) ?? $exitWithNullException())->getValue();
$secondCellValue = ($ProfSpreadshit->getCellByColumnAndRow(3,$row->getRowIndex()) ?? $exitWithNullException())->getValue(); $secondCellValue = ($ProfSpreadshit->getCellByColumnAndRow(3,$row->getRowIndex()) ?? $exitWithNullException())->getValue();

View File

@ -11,7 +11,7 @@ namespace api\module;
use database\core\Repo; use database\core\Repo;
class Formation class FormationController
{ {
public static function get($args){ public static function get($args){

View File

@ -12,8 +12,7 @@ namespace api\module\Professor;
use database\core\Repo; use database\core\Repo;
use database\repo\professor; use database\repo\professor;
class Stats class StatsController{
{
public static function get($args){ public static function get($args){
$idProf = 0; $idProf = 0;
extract($args); extract($args);

View File

@ -0,0 +1,24 @@
<?php
/**
* Created by PhpStorm.
* User: lucas
* Date: 27/02/18
* Time: 16:19
*/
namespace api\module;
use database\core\Repo;
use database\repo\professor;
class ProfessorController{
public static function get($args){
$prof_id = null;
extract($args);
return ['teachers' => [1, 2]];
}
}

View File

@ -6,7 +6,7 @@
use \error\core\Err; use \error\core\Err;
class release{ class releaseController{
/* Releases a project /* Releases a project
* *

View File

@ -5,7 +5,7 @@
use \error\core\Error; use \error\core\Error;
class root{ class rootController{
/* Generates the API documentation /* Generates the API documentation
* *