36 lines
595 B
PHP
36 lines
595 B
PHP
<?php
|
|
|
|
namespace Garradin\Plugin\Materiels;
|
|
|
|
use Garradin\DB;
|
|
|
|
class Entry // entrées définitives
|
|
{
|
|
protected $columns_order = array(
|
|
'id',
|
|
'kind',
|
|
'number_of_equipments',
|
|
'equipment_id',
|
|
'date_of_entry',
|
|
);
|
|
|
|
public function listKinds()
|
|
{
|
|
return array(
|
|
'Achat',
|
|
'Don',
|
|
'Récupération',
|
|
);
|
|
}
|
|
|
|
public function add($data = [])
|
|
{
|
|
DB::getInstance()->insert('plugin_materiels_entry', $data);
|
|
}
|
|
|
|
public function listAll()
|
|
{
|
|
return DB::getInstance()->get('SELECT * FROM plugin_materiels_entry ORDER BY date_of_entry DESC;');
|
|
}
|
|
}
|