24 lines
No EOL
578 B
PHP
24 lines
No EOL
578 B
PHP
<?php
|
|
|
|
abstract class Fiktiv_Data_Mapper_DbTable_Abstract
|
|
{
|
|
protected $_dbTable = null;
|
|
|
|
|
|
public function __construct($dbtable = null)
|
|
{
|
|
$this->setDbTable($dbtable);
|
|
}
|
|
|
|
|
|
public function setDbTable($dbtable)
|
|
{
|
|
if ($dbtable instanceof Zend_Db_Table_Abstract) {
|
|
$this->_dbTable = $dbtable;
|
|
} else if (is_string($dbtable) && class_exists($dbtable)) {
|
|
$this->_dbTable = new $dbtable();
|
|
} else {
|
|
throw new Fiktiv_Exception('Invalid database table supplied to ' . __CLASS__);
|
|
}
|
|
}
|
|
} |