/** * Sets up the widgets name etc */ public function __construct($widget_type = 'data_feed_widget', $widget_label = null, $widget_description = null, $configuration = array()) { if ($widget_label === null) { $widget_label = \__('Data Feed Widget', 'data_feed'); } if ($widget_description === null) { $widget_description = \__('Display configurable fields of the current item of a data feed', 'data_feed'); } parent::__construct($widget_type, $widget_label, array('description' => $widget_description)); $this->configuration = $configuration; $this->ql = DataFeed::component(DataFeed::OBJECT_QUERY_LANGUAGE); $this->index = 0; }
private function configurePaginationPolicy($pagination_policy) { if (empty($pagination_policy)) { $this->feed_item_cache = DataFeed::component(DataFeed::FEED_CACHE); return; } $parameters = array(); parse_str($pagination_policy, $parameters); $page_url = null; if (isset($parameters['page-url'])) { $page_url = $parameters['page-url']; } $pageUrlComponent = $this->page_url_factory->create($page_url); $page_update_check = null; if (isset($parameters['page-update-check'])) { $page_update_check = $parameters['page-update-check']; } $pageUpdateCheckComponent = $this->page_update_check_factory->create($page_update_check); $this->feed_item_cache = DataFeed::component(DataFeed::MERGING_FEED_CACHE); $this->feed_item_cache->setPageUpdateCheck($pageUpdateCheckComponent); $this->feed_item_cache->setPageUrl($pageUrlComponent); if (isset($parameters['limit']) && \is_numeric($parameters['limit'])) { $this->feed_item_cache->setLimit((int) $parameters['limit']); } }
public static function datafeed_service() { DataFeed::component(DataFeed::REST_SERVICE)->handle(); }
private static function store() { return DataFeed::component(DataFeed::FEED_STORE); }