DoctrineTable.php

Go to the documentation of this file.
00001 <?php
00002 
00033 class Robo47_Paginator_Adapter_DoctrineTable
00034 extends Robo47_Paginator_Adapter_DoctrineQuery
00035 {
00036 
00040     protected $_query;
00044     protected $_table;
00045 
00050     public function __construct($table)
00051     {
00052         $this->setTable($table);
00053     }
00054 
00061     public function setTable($table)
00062     {
00063         if (is_string($table)) {
00064             $table = Doctrine_Core::getTable($table);
00065         }
00066         if (!$table instanceof Doctrine_Table) {
00067             $message = 'table not instance of Doctrine_Table.';
00068             throw new Robo47_Log_Writer_Exception($message);
00069         }
00070         $this->_table = $table;
00071         $this->setQuery($table->createQuery()->select());
00072         return $this;
00073     }
00074 
00079     public function getTable()
00080     {
00081         return $this->_table;
00082     }
00083 }