<?php

namespace Modules\Redd\Models;

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

class GasesModel extends Model
{

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

    protected $allowedFields = ['name', 'symbol', 'atomic_number', 'atomic_mass', 'gas_group', 'period', 'global_warming_potential', '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_gases');
        $builder->where('deleted_at', null);
        $result = $builder->get()->getResult();
        return $result;
    }

}