<?php

class Model_DbTable_Panels extends Zend_Db_Table {
	protected $_name = 'Panels';

	public function insertData($data) {
		try {
			 $ID= $this -> insert($data);
			
			return $ID;
		} catch (Exception $ex) {
			
			return false;
		}
	}

	public function updateData($data) {
		try {
			
			return $this -> update($data, "STID ='" . $data["STID"] . "' AND UID ='".$data["UID"]."'");
			

		} catch(Exception $e) {
			
			return false;
		}
	}
	
	public function getAllData()
    {
       $select = $this->select();
            $select->from(array('T' => $this->_name));
            
            $select->setIntegrityCheck(false);
            return $this->fetchAll($select);
    } 
	
	public function getAllDataByUnion($id)
    {
       $select = $this->select();
            $select->from(array('T' => "UnionStructure_view"))->order("Position");
            $select->where("UID ='".$id."'");
            $select->setIntegrityCheck(false);
            return $this->fetchAll($select);
    } 

}
