public function __construct($table = '') { parent::__construct(); $this->_error = array(); $this->_fields = array(); if (empty($table)) { $this->_table = StringHelper::camelToFlat(__CLASS__); } else { $this->_table = $table; } }
public function __construct() { parent::__construct(); $this->skip = array(); foreach (get_object_vars($this) as $key => $val) { if ($key == 'skip') { continue; } $this->_init($key); $this->skip[$key] = array(); } }
/** * constructor * @param mixed $login is user login required */ public function __construct($login = false) { parent::__construct(); // get front controller instance $this->fc = FrontController::getInstance(); // instantiate page $this->page = new PageModel(); // check login ? if ($login && APP_SETUP_USER_MODEL) { if (!$this->fc->user->isLoggedIn()) { NaviHelper::redirect($this->fc->getUrl('login')); } } }
/** * constructor * @param mixed $login is user login required */ public function __construct($login = false, $iphone = false) { parent::__construct(); // get front controller instance $this->fc = FrontController::getInstance(); // instantiate page $this->page = new PageModel(); // detect iphone if (preg_match('/' . APP_IPHONE_AGENT . '/', $_SERVER['HTTP_USER_AGENT']) && !$iphone) { NaviHelper::redirect($this->fc->getUrl('iphone')); } // check login ? if ($login && APP_SETUP_USER_MODEL) { if (!$this->fc->user->isLoggedIn()) { if (is_string($login)) { if ($this->fc->controller != StringHelper::flatToCamel($login, true) || $this->fc->action != 'login') { NaviHelper::redirect($this->fc->getUrl($login, 'login')); } } else { NaviHelper::redirect($this->fc->getUrl('login')); } } } }