<?php

namespace Modules\Redd\Models;

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

class ForestsModel extends Model
{

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

    protected $allowedFields = ['name', 'alias', 'classification', 'size', 'location_description', 'geo_lat', 'geo_long', 'boundary_file', '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_forests');
        $builder->where('deleted_at', null);
        $result = $builder->get()->getResult();
        return $result;
    }

}