Initial import from local backup (Documents-Playground/pakerpale)
This commit is contained in:
31
homestead/application/models/CategoryModel.php
Normal file
31
homestead/application/models/CategoryModel.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
defined('BASEPATH') or exit('No direct script access allowed');
|
||||
|
||||
class CategoryModel extends MY_Model
|
||||
{
|
||||
|
||||
public $ca_parent;
|
||||
public $ca_title;
|
||||
public $ca_slug;
|
||||
public $ca_order;
|
||||
public $ca_hide;
|
||||
public $ca_trend;
|
||||
public $ca_hide_section;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->database();
|
||||
}
|
||||
|
||||
public function findAll() {
|
||||
return $this->db->get('news_section')->result();
|
||||
}
|
||||
|
||||
public function findByName($name) {
|
||||
$query = $this->db->where('category_name', $name)
|
||||
->get('news_section');
|
||||
return $query->num_rows() ? $query->row()->category_code : 12;
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user