Beispiel #1
0
 /**
  * Object constructor
  *
  * @param int   $id      User id
  * @param array $sql_arr SQL result set
  */
 function __construct($id = null, $sql_arr = null)
 {
     $this->rc = rcmail::get_instance();
     $this->db = $this->rc->get_dbh();
     if ($id && !$sql_arr) {
         $sql_result = $this->db->query("SELECT * FROM " . get_table_name('users') . " WHERE user_id = ?", $id);
         $sql_arr = $this->db->fetch_assoc($sql_result);
     }
     if (!empty($sql_arr)) {
         $this->ID = $sql_arr['user_id'];
         $this->data = $sql_arr;
         $this->language = $sql_arr['language'];
     }
 }