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/Model/Mapper/DbTableAbstract.php
2010-10-20 20:33:23 +02:00

34 lines
No EOL
817 B
PHP

<?php
abstract class Fiktiv_Model_Mapper_DbTableAbstract
{
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__);
}
}
public function update($data, $where)
{
return $this->_dbTable->update($data, $where);
}
public function quoteInto($text, $value)
{
return $this->_dbTable->getAdapter()->quoteInto($text,$value);
}
}