<?php

class EstadoTarea_model extends CI_Model {

    public function lista() {
        $this->db->select('id, nombre');
        $this->db->from('estados_tareas');
        $this->db->order_by('id', 'ASC');
        $query = $this->db->get();
        $estados = $query->result_array();

        $r = [];
        foreach ($estados as $e) {
            $r[$e['id']] = $e['nombre'];
        }
        return $r;
    }
}