Exemplo n.º 1
0
 /**
  * 初始化信息
  * 
  * @param array $attributes
  */
 public function init(array $attributes = array())
 {
     parent::__construct($attributes);
     $this->message_created = time();
     $this->has_read = 0;
     $this->message_is_deleted = 0;
 }
Exemplo n.º 2
0
 public function init(array $attributes = array())
 {
     parent::__construct($attributes);
     $this->demandthing_is_deleted = 0;
     $this->demandthing_click_count = 0;
     $this->demandthing_time = time();
     $this->user_id = CURRENT_YIKE;
     $this->status_id = 10;
 }
Exemplo n.º 3
0
 /**
  * 对象初始化
  * 
  * 由于构造函数对已有的对象产生影响,所以对象的初始化由 init() 完成
  * @param array $attributes
  * @return void 
  */
 public function init(array $attributes = array())
 {
     parent::__construct($attributes);
     $this->user_pwd = $this->hashpwd($attributes['user_pwd']);
     //进行密码加密
     $this->user_join_time = time();
     $this->last_login_time = time();
     $this->last_login_ip = $_SERVER['REMOTE_ADDR'];
     $this->user_is_deleted = 0;
     $this->role_id = 1;
 }
 public function __construct($attributes = array(), $guard_attributes = true, $instantiating_via_find = false, $new_record = true)
 {
     $className = (new \ReflectionClass($this))->getShortName();
     self::$table_name = strtolower($className);
     if (self::$connection == null) {
         $cfg = \ActiveRecord\Config::instance();
         self::$dsn = $cfg->get_default_connection_string();
     }
     $pdo = $this->connection()->connection;
     $this->validationRulesBuilder = new ValidationRulesBuilder(self::$table_name, self::$dsn, $pdo);
     if (!isset(self::$ruleList[self::$table_name])) {
         $this->buildRules();
         $this->populateRules();
     } else {
         // for code coverage analysis
     }
     parent::__construct($attributes, $guard_attributes, $instantiating_via_find, $new_record);
 }
Exemplo n.º 5
0
 public function init(array $attributes = array())
 {
     parent::__construct($attributes);
 }
 /**
  * Método construtor
  * @param array   $attributes             Atributo obrigatório do PHP ActiveRecord
  * @param boolean $guard_attributes       Atributo obrigatório do PHP ActiveRecord
  * @param boolean $instantiating_via_find Atributo obrigatório do PHP ActiveRecord
  * @param boolean $new_record             Atributo obrigatório do PHP ActiveRecord
  */
 public function __construct($attributes = array(), $guard_attributes = TRUE, $instantiating_via_find = FALSE, $new_record = TRUE)
 {
     parent::__construct($attributes, $guard_attributes, $instantiating_via_find, $new_record);
     return $this;
 }
 /**
  * Constructor
  *
  * @see \ActiveRecord\Model::__construct()
  * @access public
  * @param array $attributes
  * @param boolean $guard_attributes
  * @param boolean $instantiating_via_find
  * @param boolean $new_record
  */
 public function __construct(array $attributes = array(), $guard_attributes = true, $instantiating_via_find = false, $new_record = true)
 {
     $this->mergeStaticAttributes('attr_protected');
     // Call our parent constructor AFTER we've merged our static attributes
     parent::__construct($attributes, $guard_attributes, $instantiating_via_find, $new_record);
 }