aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/feed/base.php
diff options
context:
space:
mode:
authorrxu <rxu@mail.ru>2016-06-21 12:47:30 +0700
committerrxu <rxu@mail.ru>2016-07-17 21:14:13 +0700
commit3df9b2c8f813cb2458c57f487f282e6fdc97c28f (patch)
treec7fbc681e8650d5751d6ea5c55827d2b0fa088d0 /phpBB/phpbb/feed/base.php
parent9595946508c198be3aaae6deb88dee2bba354aef (diff)
downloadforums-3df9b2c8f813cb2458c57f487f282e6fdc97c28f.tar
forums-3df9b2c8f813cb2458c57f487f282e6fdc97c28f.tar.gz
forums-3df9b2c8f813cb2458c57f487f282e6fdc97c28f.tar.bz2
forums-3df9b2c8f813cb2458c57f487f282e6fdc97c28f.tar.xz
forums-3df9b2c8f813cb2458c57f487f282e6fdc97c28f.zip
[ticket/14688] Add core events to the feeds
PHPBB3-14688
Diffstat (limited to 'phpBB/phpbb/feed/base.php')
-rw-r--r--phpBB/phpbb/feed/base.php37
1 files changed, 35 insertions, 2 deletions
diff --git a/phpBB/phpbb/feed/base.php b/phpBB/phpbb/feed/base.php
index 322e2ee9f1..eeea0a55df 100644
--- a/phpBB/phpbb/feed/base.php
+++ b/phpBB/phpbb/feed/base.php
@@ -39,6 +39,12 @@ abstract class base
/** @var \phpbb\auth\auth */
protected $auth;
+ /** @var \phpbb\content_visibility */
+ protected $content_visibility;
+
+ /** @var \phpbb\event\dispatcher_interface */
+ protected $phpbb_dispatcher;
+
/** @var string */
protected $phpEx;
@@ -79,10 +85,21 @@ abstract class base
* @param \phpbb\cache\driver\driver_interface $cache Cache object
* @param \phpbb\user $user User object
* @param \phpbb\auth\auth $auth Auth object
- * @param \phpbb\content_visibility $content_visibility Auth object
+ * @param \phpbb\content_visibility $content_visibility Content visibility object
+ * @param \phpbb\event\dispatcher_interface $phpbb_dispatcher Event dispatcher object
* @param string $phpEx php file extension
*/
- function __construct(\phpbb\feed\helper $helper, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\cache\driver\driver_interface $cache, \phpbb\user $user, \phpbb\auth\auth $auth, \phpbb\content_visibility $content_visibility, $phpEx)
+ function __construct(
+ \phpbb\feed\helper $helper,
+ \phpbb\config\config $config,
+ \phpbb\db\driver\driver_interface $db,
+ \phpbb\cache\driver\driver_interface $cache,
+ \phpbb\user $user,
+ \phpbb\auth\auth $auth,
+ \phpbb\content_visibility $content_visibility,
+ \phpbb\event\dispatcher_interface $phpbb_dispatcher,
+ $phpEx
+ )
{
$this->config = $config;
$this->helper = $helper;
@@ -91,6 +108,7 @@ abstract class base
$this->user = $user;
$this->auth = $auth;
$this->content_visibility = $content_visibility;
+ $this->phpbb_dispatcher = $phpbb_dispatcher;
$this->phpEx = $phpEx;
$this->set_keys();
@@ -239,6 +257,21 @@ abstract class base
return false;
}
+ $sql_ary = $this->sql;
+
+ /**
+ * Event to modify the feed item sql
+ *
+ * @event core.feed_base_modify_item_sql
+ * @var array sql_ary The SQL array to get the feed item data
+ *
+ * @since 3.1.10-RC1
+ */
+ $vars = array('sql_ary');
+ extract($this->phpbb_dispatcher->trigger_event('core.feed_base_modify_item_sql', compact($vars)));
+ $this->sql = $sql_ary;
+ unset($sql_ary);
+
// Query database
$sql = $this->db->sql_build_query('SELECT', $this->sql);
$this->result = $this->db->sql_query_limit($sql, $this->num_items);