arse/includes/core/dao.inc.php

21 lines
367 B
PHP
Raw Normal View History

<?php
abstract class DAO
{
private $database;
public final function setDatabase( Database $database )
{
if ( $this->database !== null ) {
throw new Exception( "trying to change DAO database" );
}
$this->database = $database;
}
protected final function query( $query , $prepare = false )
{
return $this->database->query( $query , $prepare );
}
}