3 * An abstract database access class for handling database I/O requests
5 * @see DatabaseFrontendInterface An interface for database frontends
6 * (front-end to the application)
8 abstract class BaseDatabaseFrontend extends BaseFrameworkSystem implements DatabaseFrontendInterface, LimitableObject {
10 * The limiter instance
12 private $limitInstance = null;
19 private function __construct($class) {
20 // Call parent constructor
21 parent::constructor($class);
24 if (((defined('DEBUG_DATABASE')) || (defined('DEBUG_ALL'))) && (defined('DEBUG_CONSTRUCT'))) $this->getDebugInstance()->output(sprintf("[%s:] Konstruktor erreicht.<br />\n",
29 $this->removeNumberFormaters();
33 * The public constructor
37 public function constructor ($class) {
38 // Calls just the private one
39 $this->__construct($class);
43 * Getter for limitation instance
45 * @return $limitInstance The instance to the object ObjectLimits
47 public final function getLimitInstance () {
48 if ((defined('DEBUG_DATABASE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:] Limitierungsinstanz <strong>%s</strong> angefordert.<br />\n",
50 $this->limitInstance->__toString()
52 return $this->limitInstance;
56 * Setup limitation for the saving process
58 * @param $limitInstance An instance of ObjectLimits which contains
59 * elements we shall exclusivly include in
63 public final function limitObject (ObjectLimits $limitInstance) {
65 if ((defined('DEBUG_DATABASE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:] Limitierungsinstanz <strong>%s</strong> soll verwendet werden.<br />\n",
67 $limitInstance->__toString()
70 // Get limitArray for validation
71 $array = $limitInstance->getLimitArray();
73 // Sanity-check if some limitations are in the object
74 if ($array->count() > 0) {
75 // Okay, there is enougth
76 $this->limitInstance = $limitInstance;
79 if ((defined('DEBUG_DATABASE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:] Limitierungsinstanz <strong>%s</strong> wird verwendet und beinhaltet <strong>%s</strong> Einträge.<br />\n",
81 $limitInstance->__toString(),