Example #1
0
 /**
  * Constructor
  *
  * @param table Database row
  * @param integer|NULL subset to use for new object
  */
 function Chapter($db_row = NULL, $subset_ID = NULL)
 {
     // Call parent constructor:
     parent::GenericCategory('T_categories', 'cat_', 'cat_ID', $db_row);
     if (is_null($db_row)) {
         // We are creating an object here:
         $this->set('blog_ID', $subset_ID);
     } else {
         // Wa are loading an object:
         $this->blog_ID = $db_row->cat_blog_ID;
         $this->urlname = $db_row->cat_urlname;
     }
 }
Example #2
0
 /**
  * Constructor
  *
  * @param table Database row
  * @param integer|NULL subset to use for new object
  */
 function Chapter($db_row = NULL, $subset_ID = NULL)
 {
     // Call parent constructor:
     parent::GenericCategory('T_categories', 'cat_', 'cat_ID', $db_row);
     /**
      * Delete restrictions
      */
     $this->delete_restrictions = array(array('table' => 'T_categories', 'fk' => 'cat_parent_ID', 'msg' => T_('%d sub categories')), array('table' => 'T_items__item', 'fk' => 'post_main_cat_ID', 'msg' => T_('%d posts within category through main cat')), array('table' => 'T_postcats', 'fk' => 'postcat_cat_ID', 'msg' => T_('%d posts within category through extra cat')));
     if (is_null($db_row)) {
         // We are creating an object here:
         $this->set('blog_ID', $subset_ID);
     } else {
         // Wa are loading an object:
         $this->blog_ID = $db_row->cat_blog_ID;
         $this->urlname = $db_row->cat_urlname;
         $this->description = $db_row->cat_description;
         $this->order = $db_row->cat_order;
         $this->meta = $db_row->cat_meta;
         $this->lock = $db_row->cat_lock;
     }
 }