function __construct($id = NULL) { // Set language $this->help_lang(); if (!is_null($id) && ($comic = $this->get_cached($id))) { parent::__construct(); $this->all[0] = new stdClass(); foreach ($comic->to_array() as $key => $c) { $this->{$key} = $c; // fill also the all array so result_count() is correctly 1 $this->all[0]->{$key} = $c; } if (isset($comic->licenses)) { $this->licenses = $comic->licenses; } if (isset($comic->chapters)) { $this->chapters = $comic->chapters; } return TRUE; } parent::__construct(NULL); // We've overwrote the get() function so we need to look for $id from here if (!empty($id) && is_numeric($id)) { $this->where('id', $id)->get(); } }
function __construct($id = NULL) { parent::__construct(NULL); if (!is_null($id)) { $this->where('id', $id)->get(); } }
function __construct($id = NULL) { parent::__construct($id); $my_class = $this->my_class(); /* runtime relations configuration */ if (empty(self::$relations)) { $this->config->load('relations', TRUE, TRUE); } if (!isset(self::$relations[$my_class])) { self::$relations[$my_class] = array('has_many' => array(), 'has_one' => array()); } $schema = $this->config->item($my_class, 'relations'); if ($schema) { if (isset($schema['has_many'])) { self::$relations[$my_class]['has_many'] = array_merge(self::$relations[$my_class]['has_many'], $schema['has_many']); } if (isset($schema['has_one'])) { self::$relations[$my_class]['has_one'] = array_merge(self::$relations[$my_class]['has_one'], $schema['has_one']); } } reset(self::$relations[$my_class]['has_many']); foreach (self::$relations[$my_class]['has_many'] as $c => $rel) { $this->has_many($c, $rel); } reset(self::$relations[$my_class]['has_one']); foreach (self::$relations[$my_class]['has_one'] as $c => $rel) { $this->has_one($c, $rel); } }
public function __construct(Database $db, $user) { parent::__construct($db); $this->table('logins'); $this->columns(array('id', 'users_id', 'unixtime')); $this->has_one = array($user); }
function Activity($target = null) { parent::__construct(); if ($target) { $this->target_class = get_class($target); $this->target_id = $target->id; } }
function __construct($id = NULL) { // Set the translations $this->help_lang(); parent::__construct(NULL); // We've overwrote some functions, and we need to use the get() from THIS model if (!empty($id) && is_numeric($id)) { $this->where('id', $id)->get(); } }
function __construct($id = NULL) { $this->CI =& get_instance(); /* $classe = get_class($this) . '_link'; $link = new $classe; $this->has_many = array_merge($this->has_many, $link->has_many); */ parent::__construct($id); $this->getModuleStatus(); }
/** * {@inheritdoc} */ public function __construct($id = null) { $trace = debug_backtrace(); if ((empty($trace[2]['object']) || !$trace[2]['object'] instanceof DataMapper) && self::$isInstantiated) { throw new RuntimeException('System_setting can be instantiated only once!'); } if ($this->hasTable($this->prefix . $this->table)) { parent::__construct($id); } self::$isInstantiated = true; }
function __construct(\PDO $pdo) { parent::__construct($pdo); // Запрос на выборку самых новых данных каждого типа $this->selectLatestStmt = $this->pdo->prepare("SELECT *, DATE_FORMAT(`date`, '%d.%m.%Y') AS new_date FROM news WHERE date IN (SELECT MAX(date) FROM news GROUP BY type) ORDER BY type LIMIT 4"); $this->selectStmt = $this->pdo->prepare("SELECT *, DATE_FORMAT(`date`, '%d.%m.%Y в %H:%i') AS new_date FROM news WHERE id = ?"); $this->selectYearsStmt = $this->pdo->prepare("SELECT MAX(DATE_FORMAT(`date`, '%Y')) AS max, MIN(DATE_FORMAT(`date`, '%Y')) AS min FROM news"); $this->insertStmt = $this->pdo->prepare("INSERT INTO news (title, text, author, type, views, date, img) VALUES (?,?,?,?,?,?,?)"); $this->updateStmt = $this->pdo->prepare("UPDATE news SET title = ?, type = ?, text = ?, img = ? WHERE id = ?"); $this->deleteStmt = $this->pdo->prepare("DELETE FROM news WHERE id = ?"); }
function __construct($id = NULL) { // Set language $this->help_lang(); parent::__construct(NULL); // We've overwrote the get() function so we need to look for $id from here if (!empty($id) && is_numeric($id)) { $this->where('id', $id)->get(); } }
public function __construct(Database $db, $user = null) { parent::__construct($db); $this->table('blog'); $this->columns(array('id', 'title', 'content', 'unixtime')); if (!empty($user) && $user instanceof User) { $this->has_one = array($user); } else { $this->has_one = array(new User($db)); } }
function __construct($id = NULL) { if (!is_null($id) && ($team = $this->get_cached($id))) { parent::__construct(); foreach ($team->to_array() as $key => $t) { $this->{$key} = $t; // fill also the all array so result_count() is correctly 1 $this->all[0]->{$key} = $t; } return TRUE; } parent::__construct($id); }
function __construct($id = NULL) { parent::__construct($id); $my_class = $this->my_class(); /* runtime relations configuration */ if (empty(self::$relations)) { $this->config->load('relations', TRUE, TRUE); } if (!isset(self::$relations[$my_class])) { self::$relations[$my_class] = array('has_many' => array(), 'has_one' => array()); } $schema = $this->config->item($my_class, 'relations'); if ($schema) { if (isset($schema['has_many'])) { self::$relations[$my_class]['has_many'] = array_merge(self::$relations[$my_class]['has_many'], $schema['has_many']); } if (isset($schema['has_one'])) { self::$relations[$my_class]['has_one'] = array_merge(self::$relations[$my_class]['has_one'], $schema['has_one']); } } reset(self::$relations[$my_class]['has_many']); foreach (self::$relations[$my_class]['has_many'] as $c => $rel) { $this->has_many($c, $rel); } reset(self::$relations[$my_class]['has_one']); foreach (self::$relations[$my_class]['has_one'] as $c => $rel) { $this->has_one($c, $rel); } /* fill in defaults */ if (!$id) { if ($my_class == 'shift') { $my_fields = $this->get_fields(); foreach ($my_fields as $mf) { if (isset($mf['default'])) { $this->{$mf['name']} = $mf['default']; } } } } }
public function __construct($id = NULL, $abstract = FALSE) { // ci & mdi if (!MDI_Model::$_ci) { MDI_Model::$_ci =& get_instance(); } if (!MDI_Model::$_mdi) { MDI_Model::$_mdi =& MDI_Model::$_ci->mdi; } // abstract check $is_abstract = $abstract ? TRUE : $this->abstract; // abstract if ($this->abstract == FALSE) { if (empty($this->table)) { mdi::error("MDI_Model::__construct Error - table did not defined(model:" . get_class($this) . ")"); } } // load syncher if ($this->syncher == NULL) { MDI_Model::$_ci->mdi->load('features/dbsyncher'); $this->syncher = new DBSyncher(); } //build validation $this->build_validation(); // construct if (!$is_abstract) { $is_sync = FALSE; if (MDI_Model::$_ci->mdi->config('auto_db_sync')) { $is_sync = $this->syncher->sync($this); } parent::__construct($id); $this->initialize(); if ($is_sync) { $this->post_sync(); } } }
function __construct() { parent::__construct(); //$this->load->helper('security'); }
function __construct($id = 0) { parent::__construct($id); }
function __construct($id = NULL) { // add socials to validation $this->validation['social']['rules']['valid_match'] = self::$socials; parent::__construct($id); }
public function __construct($id = null) { parent::__construct($id); }
function __construct() { parent::__construct(); $this->gallery_path_staff = realpath(APPPATH . '../uploads/staff/medium/'); $this->gallery_path_url_staff = base_url() . 'uploads/staff/medium/'; }
public function __construct($id = null, $db = null) { $this->db_params = array('dbdriver' => 'mysql', 'pconnect' => true, 'db_debug' => true, 'cache_on' => false, 'char_set' => 'utf8', 'cachedir' => '', 'dbcollat' => 'utf8_general_ci', 'hostname' => 'localhost', 'username' => 'root', 'password' => '', 'database' => $db, 'prefix' => ''); parent::__construct($id); }
public function __construct($id = NULL) { parent::__construct($id); EventManager::fire("builderengine_user_construct", $this); }
function __construct(\PDO $pdo) { parent::__construct($pdo); $this->selectAllStmt = $this->pdo->prepare("SELECT * FROM committees"); $this->selectStmt = $this->pdo->prepare("SELECT * FROM committees WHERE id = ?"); }
public function __construct($id = null) { $this->status = self::STATUS_PENDING; parent::__construct($id); }
public function __construct($id = NULL) { parent::__construct($id); $this->load->library("session"); $this->load->library("jdf"); }
public function __construct($id = NULL) { parent::__construct($id); $this->_IU =& get_instance(); }
function __construct() { parent::__construct(); $this->_register_join_fields(); }
function __construct() { parent::__construct(); }
public function __construct($id = null) { parent::__construct($id); $this->__init__(); }
function __construct($id = NULL) { parent::__construct($id); }
public function __construct(Database $db, $user = null) { parent::__construct($db); $this->table('form_custom_values'); $this->columns(array('id', 'form_custom_fields_id ', 'custom_value')); }