2013-09-05 01:52:27 +00:00
|
|
|
<?php
|
2013-11-04 07:08:58 +00:00
|
|
|
namespace Open;
|
2013-09-05 01:52:27 +00:00
|
|
|
|
2013-11-04 07:08:58 +00:00
|
|
|
use \Helpers\View as view;
|
|
|
|
use \Open\Listener\OpenListener as Listener;
|
2013-09-05 01:52:27 +00:00
|
|
|
|
2013-11-04 07:08:58 +00:00
|
|
|
class Open extends \Zend_Controller_Plugin_Abstract
|
2013-09-05 01:52:27 +00:00
|
|
|
{
|
|
|
|
public $db;
|
2013-11-04 07:08:58 +00:00
|
|
|
public $config;
|
|
|
|
public $table;
|
2013-09-05 01:52:27 +00:00
|
|
|
|
|
|
|
|
2013-11-04 07:08:58 +00:00
|
|
|
|
|
|
|
public function __construct($db = NULL,$auth = NULL){
|
2013-09-05 01:52:27 +00:00
|
|
|
if(empty($db))
|
|
|
|
{
|
|
|
|
$this->db = \Zend_Registry::get('db');
|
|
|
|
}else{
|
|
|
|
$this->db = $db;
|
|
|
|
}
|
|
|
|
|
2013-11-04 07:08:58 +00:00
|
|
|
$this->config = \Zend_Registry::get('config');
|
|
|
|
|
|
|
|
$Listener = new Listener();
|
|
|
|
@$this->events()->attachAggregate($Listener);
|
|
|
|
|
|
|
|
$this->table = new \Helpers\Table();
|
2013-09-05 01:52:27 +00:00
|
|
|
}
|
|
|
|
|
2013-11-04 07:08:58 +00:00
|
|
|
public function events(\Zend_EventManager_EventCollection $events = NULL)
|
|
|
|
{
|
|
|
|
if ($events !== NULL) {
|
|
|
|
$this->events = $events;
|
|
|
|
} elseif ($this->events === NULL) {
|
|
|
|
$this->events = new \Zend_EventManager_EventManager(__CLASS__);
|
|
|
|
}
|
|
|
|
return $this->events;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function clientCredentials()
|
2013-09-05 01:52:27 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|