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