1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-30 03:20:30 +02:00

[core] store parameters values in BridgeAbstract::parameters

This way, any BridgeAbstract method can now have access to these values,
no only collectData

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
Pierre Mazière
2016-08-25 01:24:53 +02:00
parent dea37c8e34
commit 117031bf0f
131 changed files with 548 additions and 411 deletions

View File

@@ -39,21 +39,22 @@ class KununuBridge extends BridgeAbstract{
);
}
public function collectData(array $params){
public function collectData(){
$params=$this->parameters[$this->queriedContext];
// Get Site
$site = strtolower(trim($params['site']));
$site = strtolower(trim($params['site']['value']));
if(!isset($site) || empty($site) || !$this->site_is_valid($site))
$this->returnClientError('You must specify a valid site (&site=...)!');
// Get Company (fixing whitespace and umlauts)
$company = $this->encode_umlauts(strtolower(str_replace(' ', '-', trim($params['company']))));
$company = $this->encode_umlauts(strtolower(str_replace(' ', '-', trim($params['company']['value']))));
if(!isset($company) || empty($company))
$this->returnClientError('You must specify a company (&company=...)!');
$full = false; // By default we'll load only short article
if(isset($params['full']))
$full = strtolower(trim($params['full'])) === 'on';
if(isset($params['full']['value']))
$full = strtolower(trim($params['full']['value'])) === 'on';
// Get reviews section name (depends on site)
$section = '';