25 lines
434 B
PHP
25 lines
434 B
PHP
|
<?php
|
||
|
|
||
|
namespace Garradin\Plugin\Materiels;
|
||
|
|
||
|
use Garradin\Entity;
|
||
|
use Garradin\DB;
|
||
|
|
||
|
class Category extends Entity
|
||
|
{
|
||
|
const TABLE = 'plugin_materiels_category';
|
||
|
|
||
|
protected $id;
|
||
|
protected $name;
|
||
|
|
||
|
protected $_types = [
|
||
|
'id' => 'int',
|
||
|
'name' => 'string',
|
||
|
];
|
||
|
|
||
|
static public function listAll(): array
|
||
|
{
|
||
|
return DB::getInstance()->get('SELECT id, name FROM plugin_materiels_category ORDER BY name COLLATE NOCASE;');
|
||
|
}
|
||
|
}
|