<?php

namespace Modules\Redd\Models;

use CodeIgniter\Model;
use CodeIgniter\I18n\Time;

class MethodologiesModel extends Model
{

  protected $table = 'redd_methodologies';
    protected $primaryKey = 'id';

    protected $allowedFields = ['name', 'reference_link', 'description'];

    protected $returnType     = 'array';
    protected $useTimestamps  = true;
    protected $useSoftDeletes = true;
    
    protected $createdField  = 'created_at';
    protected $updatedField  = 'updated_at';
    protected $deletedField  = 'deleted_at';


    public function getAll()
    {
        $builder = $this->db->table('redd_methodologies');
        $builder->where('deleted_at', null);
        $result = $builder->get()->getResult();
        return $result;
    }

}