add open position system
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
<?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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user