Skip to content

Commit

Permalink
Use getters and setters for user defined ranking and boost.
Browse files Browse the repository at this point in the history
This follows the style of the rest of the client library.
  • Loading branch information
kasperg committed Oct 18, 2011
1 parent 74038ea commit ab4c88d
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions lib/request/TingClientSearchRequest.php
Expand Up @@ -32,8 +32,8 @@ class TingClientSearchRequest extends TingClientRequest {
protected $relationData;
protected $agency;
protected $profile;
var $userDefinedBoost;
var $userDefinedRanking;
protected $userDefinedBoost;
protected $userDefinedRanking;

public function getRequest() {
$parameters = $this->getParameters();
Expand All @@ -56,6 +56,8 @@ public function getRequest() {
'relationData' => 'relationData',
'agency' => 'agency',
'profile' => 'profile',
'userDefinedBoost' => 'userDefinedBoost',
'userDefinedRanking' => 'userDefinedRanking',
);

foreach ($methodParameterMap as $method => $parameter) {
Expand All @@ -75,16 +77,6 @@ public function getRequest() {
));
}

// Include userDefinedBoost if set on the request.
if (is_array($this->userDefinedBoost) && !empty($this->userDefinedBoost)) {
$this->setParameter('userDefinedBoost', $this->userDefinedBoost);
}

// Include userDefinedRanking if set on the request.
if (is_array($this->userDefinedRanking) && !empty($this->userDefinedRanking)) {
$this->setParameter('userDefinedRanking', $this->userDefinedRanking);
}

return $this;
}

Expand Down Expand Up @@ -192,6 +184,22 @@ public function setProfile($profile) {
$this->profile = $profile;
}

public function getUserDefinedBoost() {
return $this->userDefinedBoost;
}

public function setUserDefinedBoost($userDefinedBoost) {
$this->userDefinedBoost = $userDefinedBoost;
}

public function getUserDefinedRanking() {
return $this->userDefinedRanking;
}

public function setUserDefinedRanking($userDefinedRanking) {
$this->userDefinedRanking = $userDefinedRanking;
}

public function processResponse(stdClass $response) {
$searchResult = new TingClientSearchResult();

Expand Down

0 comments on commit ab4c88d

Please sign in to comment.