<?php

class Model_DbTable_Accreditation extends Zend_Db_Table
{
    protected $_name = 'Accreditation';
    
   public function insertData($data)
    {
       
       try{
           $id = $this->insert($data);
           return $id;
       }catch(Exception $e){
          return  false;
       }
       
    }
    
    //RelationshipStatus 
     
   public function getAll()
    {
       $select = $this->select();
       $select->from(array('t' => $this->_name))->order("AccreditationID ASC");
               
    	$select->setIntegrityCheck(false);
    	return $this->fetchAll($select);
    }  
	
	public function getAllView()
    {
       $select = $this->select();
       $select->from(array('t' => "Accreditations_view"),array("AC","AccreditationName","OpenDate","CloseDate","Active","aCode","Location"));
       $select->order(array("OpenDate DESC","AccreditationName ASC"));
               
    	$select->setIntegrityCheck(false);
    	return $this->fetchAll($select);
    }  
	
    
}