PHP Classes

File: app/models/AlertsDAO.php

Recommend this page to a friend!
  Classes of Brett Dutton   JackBooted PHP Framework   app/models/AlertsDAO.php   Download  
File: app/models/AlertsDAO.php
Role: Class source
Content type: text/plain
Description: Class source
Class: JackBooted PHP Framework
Web application framework using simplified MVC
Author: By
Last change:
Date: 8 years ago
Size: 2,052 bytes
 

Contents

Class file image Download
<?php
namespace App\Models;
use \
Jackbooted\DB\DB;
use \
Jackbooted\Util\Log4PHP;
use \
Jackbooted\DB\DAO;

class
AlertsDAO extends DAO {
    private static
$log;

    public static function
init () {
       
self::$log = Log4PHP::logFactory ( __CLASS__ );
    }
    public function
__construct () {
       
$this->db = DB::DEF;
       
$this->primaryKey = 'fldModJackAlertID';
       
$this->keyFormat = 'AL0000000';
       
$this->tableName = 'tblModJackAlert';
       
$this->tableStructure = <<<SQL
CREATE TABLE {$this->tableName} (
             
{$this->primaryKey} char(11) NOT NULL,
              fldErrorID char(11) NOT NULL,
              fldType char(6) NOT NULL,
              fldProcess varchar(50) NOT NULL,
              fldDescription varchar(200) NOT NULL,
              fldStatus char(6) NOT NULL DEFAULT 'new',
              fldTimeStamp datetime NOT NULL DEFAULT current_timestamp,
              PRIMARY KEY (
{$this->primaryKey})
            );
SQL;

       
/* This is the mapping between the object names and the column names
         * Please note that you can access data as different names
         */
       
$this->orm = [ 0 => $this->primaryKey,
                      
1 => 'fldErrorID',
                      
2 => 'fldType',
                      
3 => 'fldProcess',
                      
4 => 'fldDescription',
                      
5 => 'fldStatus',
                      
'id' => $this->primaryKey,
                      
'errorID' => 'fldErrorID',
                      
'error_id' => 'fldErrorID',
                      
'type' => 'fldType',
                      
'process' => 'fldProcess',
                      
'desc' => 'fldDescription',
                      
'description' => 'fldDescription',
                      
'status' => 'fldStatus',
                     ];

       
$this->titles = [ $this->primaryKey => 'ID',
                        ];

       
parent::__construct();
    }
}