<?php

namespace Modules\Redd\Models;

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

class CarbonPoolsModel extends Model
{

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

    protected $allowedFields = ['name', '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_carbon_pools');
        $builder->where('deleted_at', null);
        $result = $builder->get()->getResult();
        return $result;
    }

}