<?php
class Pampa_Auth_Adapter_Admin {

  // the class instance
  static private $instance;

  // the adapter reference
  private $_adapter;

  public function __construct() {
    // creates the adapter
    $adapter = new Zend_Auth_Adapter_DbTable(Zend_Db_Table::getDefaultAdapter());
    $adapter->setTableName("go2pet_clientes");
    $adapter->setIdentityColumn("email");
    $adapter->setCredentialColumn("senha");
    $adapter->setCredentialTreatment("MD5(?)");

    // referencia
    $this->_adapter = $adapter;

  }

  /**
   * returns a reference of the class
   * @return Pampa_Auth_Adapter_Cms
   */
  static public function getInstance() {
    if (!isset(self::$instance)) {
      $c = __CLASS__;
      self::$instance = new $c;
    }

    return self::$instance;
  }

  /**
   * returns the adapter
   * @return Zend_Auth_Adapter_DbTable
   */
  public function getAdapter() {
    return $this->_adapter;
  }

}