1
1
<?php defined ('SYSPATH ' ) or die ('No direct script access. ' );
2
2
// HT: New model
3
3
/**
4
- * Model for Categories for each Feed
4
+ * Model for Categories for each Feed Item
5
5
*
6
6
* PHP version 5
7
7
* LICENSE: This source file is subject to LGPL license
14
14
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License (LGPL)
15
15
*/
16
16
17
- class Feed_Category_Model extends ORM
17
+ class Feed_Item_Category_Model extends ORM
18
18
{
19
19
protected $ belongs_to = array ('feed_item ' , 'category ' );
20
20
21
21
// Database table name
22
- protected $ table_name = 'feed_category ' ;
22
+ protected $ table_name = 'feed_item_category ' ;
23
23
24
24
/**
25
- * Assigns a category id to an feed if it hasn't already been assigned
25
+ * Assigns a category id to an feed item if it hasn't already been assigned
26
26
* @param int $feed_id feed to assign the category to
27
27
* @param int $category_id category id of the category you want to assign to the feed
28
28
* @return array
@@ -33,14 +33,14 @@ public static function assign_category_to_feed($feed_id,$category_id)
33
33
// Check to see if it is already added to that category
34
34
// If it's not, add it.
35
35
36
- $ feed_category = ORM ::factory ('feed_category ' )->where (array ('feed_item_id ' =>$ feed_id ,'category_id ' =>$ category_id ))->find_all ();
36
+ $ feed_item_category = ORM ::factory ('feed_item_category ' )->where (array ('feed_item_id ' =>$ feed_id ,'category_id ' =>$ category_id ))->find_all ();
37
37
38
- if ( ! $ feed_category ->count () )
38
+ if ( ! $ feed_item_category ->count () )
39
39
{
40
- $ new_feed_category = ORM ::factory ('feed_category ' );
41
- $ new_feed_category ->category_id = $ category_id ;
42
- $ new_feed_category ->feed_item_id = $ feed_id ;
43
- $ new_feed_category ->save ();
40
+ $ new_feed_item_category = ORM ::factory ('feed_item_category ' );
41
+ $ new_feed_item_category ->category_id = $ category_id ;
42
+ $ new_feed_item_category ->feed_item_id = $ feed_id ;
43
+ $ new_feed_item_category ->save ();
44
44
}
45
45
46
46
return true ;
0 commit comments