<commit_before><commit_msg>Se agrego el archivo "Categorias_model"<commit_after><?php
defined('BASEPATH') OR exit('No direct script access allowed');

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
class Categorias_model extends CI_Model{
    public $id;
    public $nombre;
    public $usuarios_id;
    public $fechaCreachon;
    public $estatus;
    
    
    public function obtenerTodos()
    {
        $query = $this->db->get("categorias");
        return $query->result_array();
    }

    public function obtenerPorId($id)
    {
        $query = $this->db->get_where("categorias", ["id" => $id], 1);
        return $query->row_array();
    }

    public function crear($data)
    {
        return $this->db->insert("categorias", $data) ? true : false;
    }

    public function editar($id, $data)
    {
        return $this->db->where("id", $id)->update("categorias", $data) ? true : false;
    }

    public function eliminar($id)
    {
        return $this->db->where("id", $id)->update("categorias", ["estatus" => 0]) ? true : false;
    }
}

{'fraction_non_alphanumeric': 0.14848993288590603, 'fraction_numerical': 0.0016778523489932886, 'mean_word_length': 2.9899665551839463, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7543630', 'n_tokens_mistral': 385, 'n_tokens_neox': 383, 'n_words': 97}