Skip to content
Snippets Groups Projects
Commit 2e00b11d authored by Florian Azizian's avatar Florian Azizian
Browse files

FEAT #5661 status administration MVC

parent 898b4c26
No related branches found
No related tags found
No related merge requests found
......@@ -19,6 +19,7 @@ use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use Respect\Validation\Validator;
use Core\Models\StatusModel;
use Core\Models\StatusImagesModel;
use Core\Models\ServiceModel;
class StatusController
......@@ -44,7 +45,7 @@ class StatusController
}
$datas = [
'statusImages' => StatusModel::getStatusImages(),
'statusImages' => StatusImagesModel::getStatusImages(),
'lang' => StatusModel::getStatusLang()
];
......@@ -68,8 +69,8 @@ class StatusController
return $response->withJson([
'status' => $obj,
'lang' => StatusModel::getStatusLang(),
'statusImages' => StatusModel::getStatusImages(),
'lang' => StatusModel::getStatusLang(),
'statusImages' => StatusImagesModel::getStatusImages(),
]);
} else {
return $response->withStatus(400)->withJson(['errors' => 'identifier not valid']);
......
<?php
/**
* Copyright Maarch since 2008 under licence GPLv3.
* See LICENCE.txt file at the root folder for more details.
* This file is part of Maarch software.
*
*/
/**
* @brief Status Images Model
* @author dev@maarch.org
* @ingroup core
*/
namespace Core\Models;
class StatusImagesModel extends StatusImagesModelAbstract
{
// Do your stuff in this class
}
<?php
/**
* Copyright Maarch since 2008 under licence GPLv3.
* See LICENCE.txt file at the root folder for more details.
* This file is part of Maarch software.
*
*/
/**
* @brief Status Images Model
* @author dev@maarch.org
* @ingroup core
*/
namespace Core\Models;
require_once 'apps/maarch_entreprise/services/Table.php';
class StatusImagesModelAbstract extends \Apps_Table_Service
{
public static function getStatusImages(array $aArgs = [])
{
$aReturn = static::select([
'select' => empty($aArgs['select']) ? ['*'] : $aArgs['select'],
'table' => ['status_images'],
'order_by' => 'id'
]);
return $aReturn;
}
}
......@@ -109,14 +109,4 @@ class StatusModelAbstract extends \Apps_Table_Service
return $aReturn;
}
public static function getStatusImages(array $aArgs = [])
{
$aReturn = static::select([
'select' => empty($aArgs['select']) ? ['*'] : $aArgs['select'],
'table' => ['status_images'],
'order_by' => 'id'
]);
return $aReturn;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment