<?php
class AclassModel extends CmlModel {
	public function addclass($classname,$classseo){
		$classok=$this->db()->set('article_class', array('classname'=>$classname,'classseo'=>$classseo),true);
		$this->cache()->delete('classall');
		return $classok;
	}
	
	public function editclass($classid,$classcid,$classname,$classseo){
		$classok=$this->db()->update('article_class-id-'.$classid, array('cid'=>$classcid,'classname'=>$classname,'classseo'=>$classseo),true);
		$this->cache()->delete('classall');
		return $classok;
	}
	
	public function delclass($classid){
		$classok=$this->db()->delete('article_class-id-'.$classid);
		$this->cache()->delete('classall');
		return $classok;
	}
	
	public function indexclass(){
		$classdata=$this->db()->table('article_class')->orderBy('cid', 'DESC')->select();
		return $classdata;
	}
	
}