-
Notifications
You must be signed in to change notification settings - Fork 0
/
tag_model.php
115 lines (100 loc) · 2.41 KB
/
tag_model.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<?php
class Tag_model extends CI_Model {
function __construct()
{
parent::__construct();
}
/* all_tags_read SELECTS * from 'all_tags'.
* @param
* @return
* @throw
*/
/* get SELECTS * FROM 'all_tags' WHERE .
* @param
* @return
* @throw
*/
function get_all( ) {
// post-values, db call
$dbGet = $this->db->get("all_tags");
$tag = $dbGet->result();
return $tag;
}
/* tag_categories_read SELECTS * from 'all_tags'.
* @param
* @return
* @throw
*/
function categories_get() {
$dbGet = $this->db->get("tag_categories");
$cat = $dbGet->result();
return $cat;
}
//////////////// CRUD FUNCTIONS FOR TAG CATEGORIES -- BEGIN
///////////////////////////////////////////////////
/* tag_category_create INSERTS tag category name into 'tag_categories' (table).
* @param
* @return
* @throw
*/
function tag_category_create() {
// use post data to insert to tag_categories table
}
/* tag_category_update UPDATES numeric (1-5) value, user_id value and cit_id value in 'user_ratings'.
* @param
* @return
* @throw
*/
function tag_category_update() {
// get user info
}
/* tag_category_remove INSERT numeric cit_id value and user_id value in 'user_cit_favorites'.
* @param
* @return
* @throw
*/
function tag_category_remove() {
// get user info
}
//////////////// CRUD FUNCTIONS FOR TAG CATEGORIES -- END
///////////////////////////////////////////////////
//////////////// CRUD FUNCTIONS FOR INDIVIDUAL TAGS -- BEGIN
///////////////////////////////////////////////////
/* get SELECTS * FROM 'all_tags' WHERE .
* @param
* @return
* @throw
*/
function get( $tag_id ) {
// post-values, db call
$dbQry = array("tag_id"=>$tag_id);
$dbGet = $this->db->get_where("all_tags", $dbQry);
$tag = $dbGet->result();
return $tag;
}
/* tag_create INSERTS tag_name into 'all_tags'.
* @param
* @return
* @throw
*/
function put( $tag, $cat_id ) {
// post-values, db call
$dbQry = array("tag"=>$tag, "cat_id"=>$cat_id );
$dbGet = $this->db->insert("all_tags", $dbQry);
if ($dbGet) {
return true; }
else {
return false; }
}
/* tag_delete REMOVES tag_name into 'all_tags'.
* @param
* @return
* @throw
*/
function tag_delete() {
}
//////////////// CRUD FUNCTIONS FOR INDIVIDUAL TAGS -- END
///////////////////////////////////////////////////
}
/* end of tag_model.php */
/* location: appname/application/models/ */