Archived
1
0
Fork 0
This repository has been archived on 2026-05-10. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
fiktivkod/library/Fiktiv/Data/Mapper/DbTable/Abstract.php
2010-09-11 20:10:43 +02:00

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__);
}
}
}