36 lines
828 B
PHP
36 lines
828 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use CodeIgniter\Model;
|
|
|
|
class JobPositionModel extends Model
|
|
{
|
|
protected $table = 'job_positions';
|
|
protected $primaryKey = 'position_id';
|
|
protected $useAutoIncrement = false;
|
|
protected $returnType = 'array';
|
|
protected $allowedFields = [
|
|
'position_id',
|
|
'template_id',
|
|
'title',
|
|
'description',
|
|
'department',
|
|
'location',
|
|
'employment_type',
|
|
'requirements',
|
|
'status',
|
|
'posted_by',
|
|
'created_at',
|
|
'updated_at',
|
|
];
|
|
protected $useTimestamps = true;
|
|
protected $createdField = 'created_at';
|
|
protected $updatedField = 'updated_at';
|
|
|
|
public function openPositions(): array
|
|
{
|
|
return $this->where('status', 'open')->orderBy('created_at', 'DESC')->findAll();
|
|
}
|
|
}
|