<commit_before><?php

class Advertisements_model extends CI_Model {

    function __construct() {

        // Call the Model constructor
        parent::__construct();
    }

    // Get all entries from advertisement
    function getAdList() {

        $sql = "SELECT * FROM advertisement ORDER BY enabled DESC";
        $query = $this->db->query($sql);

        return $query->result();
    }
}<commit_msg>Created functions add, delete, enable and get all advertisement<commit_after><?php

class Advertisements_model extends CI_Model {

    function __construct() {

        // Call the Model constructor
        parent::__construct();
    }

    // Get all entries from advertisement
    function getAdList() {

        $sql = "SELECT * FROM advertisement ORDER BY enabled DESC";
        $query = $this->db->query($sql);

        return $query->result();
    }

    // Insert advertisement
    function add($data) {

        $this->db->insert("advertisement", $data);
        die();
    }

    // Delete advertisement
    function delete($data) {

        $this->db->delete("advertisement", $data);
        die();
    }

    // Enable advertisement
    function enable($id, $boolean) {

        $this->db->update("advertisement", array("enabled" => $boolean), array("id" => $id));;
        die();
    }
}
{'fraction_non_alphanumeric': 0.13705972434915772, 'fraction_numerical': 0.0, 'mean_word_length': 2.485333333333333, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '813611', 'n_tokens_mistral': 379, 'n_tokens_neox': 343, 'n_words': 95}