Current File : /home/karenpetzb/application/models/AnnonceGallery.php
<?php
class AnnonceGallery extends Zend_Db_Table
{
    protected $_name = 'annonce_gallery';
    protected $_primary = 'ID';

    public function getAnnonces() {
    	return $this->select()->where('isSHOW = 0')->order('POSITION ASC')->order('NOM ASC')->query()->fetchAll();
	}
	

    public function getAllAnnonces() {
    	return $this->select()->order('POSITION ASC')->order('NOM ASC')->query()->fetchAll();
	}
    
    public function getAllAnnoncesByCategory($idCat) {
    	return $this->select()->where("ID_CATS LIKE '%:".$idCat.":%' OR ID_CATS LIKE '%:0:%' ")->order('POSITION ASC')->order('NOM ASC')->query()->fetchAll();
 	}
	
 	public function getAnnoncesByShow($idCat) {
 		return $this->select()->where('isSHOW = 0')->where("ID_CATS LIKE '%:".$idCat.":%' OR ID_CATS LIKE '%:0:%' ")->order('POSITION ASC')->order('NOM ASC')->query()->fetchAll();
 	}
}
?>