Blame view

modules/default/model/brends.class.php 977 Bytes
8d65d0ce   andryeyev   init
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
  <?php
  Class Brends{
  	private $db;
  	private $lang;
  	
   
  	function __construct($lang){
  		$this->db = sdb::getInstance();
  		$this->lang = $lang;
  	}
  	
  	public function getBrends(){
  		$sql = "select * from catalogs_brends order by sort asc";
  		return $this->db->getAll($sql,array(),DB_FETCHMODE_ASSOC);
  	}
  	
  
  	private function getParentID($id){
  		return $this->db->getOne("select parent_id from catalogs_brends where id=?", array($id));
  	}
  	
  	public function getTranslit($filter_translit){
  		return $this->db->getOne("select id from catalogs_brends where translit=?",array($filter_translit));
  	}
  	
  	public function getTranslitStr($filter_translit){
  		$t = explode(',',$filter_translit);
  		$id = array();
  		foreach($t as $r){
  			$id[] = $this->db->getOne("select id from catalogs_brends where translit=?",array($r));
  		}
  		return $id;
  	}	
  	
  	public function getBrend($id){
  		return $this->db->getRow("select * from catalogs_brends where id=?",array($id),DB_FETCHMODE_ASSOC);
  	}
  	
  }
  ?>