Exemplo n.º 1
0
 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();
     }
 }
Exemplo n.º 2
0
 function __construct($id = NULL)
 {
     parent::__construct(NULL);
     if (!is_null($id)) {
         $this->where('id', $id)->get();
     }
 }
Exemplo n.º 3
0
 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);
     }
 }
Exemplo n.º 4
0
 public function __construct(Database $db, $user)
 {
     parent::__construct($db);
     $this->table('logins');
     $this->columns(array('id', 'users_id', 'unixtime'));
     $this->has_one = array($user);
 }
Exemplo n.º 5
0
 function Activity($target = null)
 {
     parent::__construct();
     if ($target) {
         $this->target_class = get_class($target);
         $this->target_id = $target->id;
     }
 }
Exemplo n.º 6
0
 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();
     }
 }
Exemplo n.º 7
0
 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();
 }
Exemplo n.º 8
0
 /**
  * {@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;
 }
Exemplo n.º 9
0
 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 = ?");
 }
Exemplo n.º 10
0
	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();
		}
	}
Exemplo n.º 11
0
 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));
     }
 }
Exemplo n.º 12
0
 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);
 }
Exemplo n.º 13
0
 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'];
                 }
             }
         }
     }
 }
Exemplo n.º 14
0
 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();
         }
     }
 }
Exemplo n.º 15
0
 function __construct()
 {
     parent::__construct();
     //$this->load->helper('security');
 }
Exemplo n.º 16
0
 function __construct($id = 0)
 {
     parent::__construct($id);
 }
Exemplo n.º 17
0
 function __construct($id = NULL)
 {
     // add socials to validation
     $this->validation['social']['rules']['valid_match'] = self::$socials;
     parent::__construct($id);
 }
Exemplo n.º 18
0
Arquivo: umeta.php Projeto: Moro3/duc
 public function __construct($id = null)
 {
     parent::__construct($id);
 }
Exemplo n.º 19
0
 function __construct()
 {
     parent::__construct();
     $this->gallery_path_staff = realpath(APPPATH . '../uploads/staff/medium/');
     $this->gallery_path_url_staff = base_url() . 'uploads/staff/medium/';
 }
Exemplo n.º 20
0
 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);
 }
Exemplo n.º 21
0
 public function __construct($id = NULL)
 {
     parent::__construct($id);
     EventManager::fire("builderengine_user_construct", $this);
 }
Exemplo n.º 22
0
 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 = ?");
 }
Exemplo n.º 23
0
 public function __construct($id = null)
 {
     $this->status = self::STATUS_PENDING;
     parent::__construct($id);
 }
Exemplo n.º 24
0
 public function __construct($id = NULL)
 {
     parent::__construct($id);
     $this->load->library("session");
     $this->load->library("jdf");
 }
Exemplo n.º 25
0
Arquivo: log.php Projeto: jotavejv/CMS
 public function __construct($id = NULL)
 {
     parent::__construct($id);
     $this->_IU =& get_instance();
 }
Exemplo n.º 26
0
 function __construct()
 {
     parent::__construct();
     $this->_register_join_fields();
 }
Exemplo n.º 27
0
 function __construct()
 {
     parent::__construct();
 }
Exemplo n.º 28
0
 public function __construct($id = null)
 {
     parent::__construct($id);
     $this->__init__();
 }
Exemplo n.º 29
0
 function __construct($id = NULL)
 {
     parent::__construct($id);
 }
Exemplo n.º 30
0
 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'));
 }