mirror of
https://github.com/JGH0/Todo-App-Backend.git
synced 2026-06-03 13:28:47 +02:00
32 lines
666 B
PHP
32 lines
666 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use CodeIgniter\Model;
|
|
|
|
class CategoryModel extends Model
|
|
{
|
|
protected $table = 'categories';
|
|
protected $primaryKey = 'id';
|
|
protected $useAutoIncrement = false;
|
|
protected $returnType = 'array';
|
|
protected $useSoftDeletes = false;
|
|
protected $allowedFields = [
|
|
'id',
|
|
'user_id',
|
|
'name',
|
|
'color',
|
|
'favorite',
|
|
'created_at',
|
|
];
|
|
|
|
protected $useTimestamps = true;
|
|
protected $createdField = 'created_at';
|
|
protected $updatedField = '';
|
|
|
|
protected $validationRules = [
|
|
'user_id' => 'required',
|
|
'name' => 'required|max_length[255]',
|
|
];
|
|
}
|