Beispiel #1
0
 protected function setupAdapter($adapter)
 {
     if (!$adapter && !($adapter = $this->getAdapter()) && !($adapter = AdapterPool::get())) {
         throw new Exception\RuntimeException('Adapter must be setup');
     }
     $this->setAdapter($adapter);
 }
Beispiel #2
0
 /**
  * @param AdapterInterface $adapter
  * @param string|TableIdentifier $table
  */
 public function __construct(AdapterInterface $adapter = null, $table = null)
 {
     if (!$adapter && !($adapter = AdapterPool::get())) {
         throw new Exception\RuntimeException('A adapter must be suplied');
     }
     $this->adapter = $adapter;
     if ($table) {
         $this->setTable($table);
     }
 }