public static function getInstance() { if (!self::$instance) { self::$instance = new baseModel(); } return self::$instance; }
public function __construct() { parent::__construct(); // Needs to be here $this->load->database(); date_default_timezone_set('UTC'); }
public function queryString($key) { /* * * get the route from the url ** */ $requestPath = empty($_SERVER['REQUEST_URI']) ? '' : $_SERVER['REQUEST_URI']; if (substr($requestPath, strlen($requestPath) - 1, strlen($requestPath) - 1) == "/") { $requestPath = substr($requestPath, 0, strlen($requestPath) - 1); } $this->model = baseModel::getInstance(); $rewriteModel = $this->model->get('rewrite'); $rewriteInfo = $rewriteModel->getRewriteInfo($requestPath); if (count($rewriteInfo) > 0) { $route = $rewriteInfo['target_path']; } else { $route = $requestPath; } if (empty($route)) { return null; } else { /* * * get the parts of the route ** */ $parts = explode('/', $route); array_shift($parts); if (isset($parts[3])) { $count_args = count($parts); for ($i = 3; $i < $count_args; $i++) { if ($parts[$i] == $key) { if (isset($parts[$i + 1])) { return $parts[$i + 1]; } } } } } return null; }
public function __construct() { parent::__construct(); $this->pid = 0; $this->uid = 0; $this->uptime = time(); }
function __construct($registry) { $this->registry = $registry; $this->model = baseModel::getInstance(); $this->view = baseView::getInstance(); $this->request = request::getInstance(); $this->init(); }
function __construct($projectid = null) { parent::__construct(); $projectid = $projectid ? $projectid : JRequest::getInt('p'); if ($projectid) { $this->setProjectId($projectid); } }
public static function lastEntry($user_id) { parent::dbCOnnect(); $query = "SELECT * FROM ad_list WHERE user_id = {$user_id} ORDER BY id DESC LIMIT 1;"; $results = parent::$dbc->query($query)->fetch(PDO::FETCH_ASSOC); $ad_id = (int) $results['id']; return $ad_id; }
function __construct($projectid = null) { parent::__construct(); $projectid = $projectid ? $projectid : JFactory::getApplication()->input->getInt('p', 0); if ($projectid) { $this->setProjectId($projectid); } }
public function __construct() { parent::__construct(); $this->pid = 0; $this->uid = 0; $this->addtime = time(); $this->received = false; $this->status = 0; }
function __construct($blockName) { parent::__construct(); $this->model = baseModel::getInstance(); $this->name = $blockName; $this->request = request::getInstance(); $this->init(); $this->renderHtml(); }
/** * * @global array $config * @return object database instance */ public static function dbInstance() { global $config; //var_dump($config); if (self::$instance === NULL) { self::$instance = new PDO("mysql:host={$config['db']['host']};dbname={$config['db']['dbname']}", "{$config['db']['username']}", "{$config['db']['password']}"); self::$instance->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } //$this->conn = self::$instance; return self::$instance; }
function __construct() { /* * * get the route from the url ** */ $requestPath = empty($_SERVER['REQUEST_URI']) ? '' : $_SERVER['REQUEST_URI']; if (substr($requestPath, strlen($requestPath) - 1, strlen($requestPath) - 1) == "/") { $requestPath = substr($requestPath, 0, strlen($requestPath) - 1); } $this->model = baseModel::getInstance(); $rewriteModel = $this->model->get('rewrite'); $rewriteInfo = $rewriteModel->getRewriteInfo($requestPath); if (count($rewriteInfo) > 0) { $route = $rewriteInfo['target_path']; } else { $route = $requestPath; } $parts = explode('/', $route); array_shift($parts); if (empty($route)) { $route = 'default/index'; } else { /* get the parts of the route */ if (isset($parts[0])) { $this->module = $parts[0]; } if (isset($parts[1])) { $this->controller = $parts[1]; } if (isset($parts[2])) { $this->action = $parts[2]; } if (isset($parts[3])) { $count_args = count($parts); $k = 1; $args = array(); for ($i = 3; $i < $count_args; $i++) { $args[$k++] = $parts[$i]; } $this->args = $args; } } if (empty($this->module)) { $this->module = 'default'; } if (empty($this->controller)) { $this->controller = 'index'; } /* Get action */ if (empty($this->action)) { $this->action = 'index'; } $file = APP_PATH . '/modules/' . $this->module . '/controllers/' . $this->controller . 'Controller.php'; }
public function __construct() { parent::__construct(get_class()); // Needs to be here $this->load->database(); }
function __construct() { parent::__construct(); $this->_id = JRequest::getInt('i'); }
public function __construct() { parent::__construct(); }
public function homeControl() { parent::__construct(); $this->loadModel('home'); }
/** * Constructor * * @param array $config An array of configuration options (name, state, dbo, table_path, ignore_request). */ public function __construct($config = array()) { parent::__construct(); $this->setProjectId(JFactory::getApplication()->input->getInt('p', 0)); }
public function homeControl() { parent::__construct(); $this->loadModel('champion'); $this->tpl->assign('appName', 'championPage'); }
protected function majWithXmlDatas() { parent::majWithXmlDatas(); $this->reqLimit = (int) $this->xml["reqLimit"]; $this->currentPaginationNumber = 1; //$this->refreshNumElements(); }
public function __construct() { $this->db = baseModel::getInstance(); }