ใน phpBB ทำไมบางตารางถึงไม่ใช้ชื่อตารางที่ define ไว้ เเต่ใช้เป็น __construct แทน

ตอบกระทู้

รูปแสดงอารมณ์
:icon_plusone: :like: :plusone: :gfb: :-D :) :( :-o 8O :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: :angry: :baa: :biggrin:
รูปแสดงอารมณ์อื่นๆ

BBCode เปิด
[img] เปิด
[url] เปิด
[Smile icon] เปิด

กระทู้แนะนำ
   

มุมมองที่ขยายได้ กระทู้แนะนำ: ใน phpBB ทำไมบางตารางถึงไม่ใช้ชื่อตารางที่ define ไว้ เเต่ใช้เป็น __construct แทน

ใน phpBB ทำไมบางตารางถึงไม่ใช้ชื่อตารางที่ define ไว้ เเต่ใช้เป็น __construct แทน

โดย thatsawan » 03/10/2015 3:45 pm

โค้ด: เลือกทั้งหมด

public function __construct(\phpbb\user_loader $user_loader, \phpbb\db\driver\driver_interface $db, \phpbb\cache\driver\driver_interface $cache, $user, \phpbb\auth\auth $auth, \phpbb\config\config $config, \phpbb\controller\helper $helper, $phpbb_root_path, $php_ext, $notification_types_table, $notifications_table, $user_notifications_table)
    {
        $this->user_loader = $user_loader;
        $this->db = $db;
        $this->cache = $cache;
        $this->user = $user;
        $this->auth = $auth;
        $this->config = $config;
        $this->helper = $helper;

        $this->phpbb_root_path = $phpbb_root_path;
        $this->php_ext = $php_ext;

        $this->notification_types_table = $notification_types_table;
        $this->notifications_table = $notifications_table;
        $this->user_notifications_table = $user_notifications_table;
    }

โค้ด: เลือกทั้งหมด

    // Get the total number of notifications
            $sql = 'SELECT COUNT(n.notification_id) AS total_count
                FROM ' . $this->notifications_table . ' n, ' . $this->notification_types_table . ' nt
                WHERE n.user_id = ' . (int) $options['user_id'] . '
                    AND nt.notification_type_id = n.notification_type_id
                    AND nt.notification_type_enabled = 1';
            $result = $this->db->sql_query($sql);
            $total_count = (int) $this->db->sql_fetchfield('total_count');
            $this->db->sql_freeresult($result);
$this->notifications_table

ข้างบน