Skip to content

Commit

Permalink
made some properties public
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-graute committed May 27, 2021
1 parent 391462c commit 336f825
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/Pressmind/Search/Condition/HousingOption.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,24 @@ class HousingOption implements ConditionInterface
/**
* @var integer|null
*/
private $_occupancy;
public $occupancy;

/**
* @var array
*/
private $_status;
public $status;

/**
* HousingOption constructor.
* @param null $occupancy
* @param array $status
*/
public function __construct($occupancy = null, $status = [HelperFunctions::HOUSING_OPTION_STATUS_ACTIVE, HelperFunctions::HOUSING_OPTION_STATUS_LOW, HelperFunctions::HOUSING_OPTION_STATUS_REQUEST]) {
$this->_occupancy = $occupancy;
$this->occupancy = $occupancy;
if(!is_array($status)) {
$status = [intval($status)];
}
$this->_status = $status;
$this->status = $status;
}

/**
Expand All @@ -43,10 +43,10 @@ public function __construct($occupancy = null, $status = [HelperFunctions::HOUSI
public function getSQL()
{
$conditions = [];
if(!is_null($this->_occupancy)) {
if(!is_null($this->occupancy)) {
$conditions[] = '(:occupancy BETWEEN pmt2core_cheapest_price_speed.option_occupancy_min AND pmt2core_cheapest_price_speed.option_occupancy_max OR :occupancy = pmt2core_cheapest_price_speed.option_occupancy)';
}
if(!empty($this->_status)) {
if(!empty($this->status)) {
$conditions[] = 'pmt2core_cheapest_price_speed.state IN (:status)';
}
return implode(' AND ', $conditions);
Expand All @@ -58,11 +58,11 @@ public function getSQL()
public function getValues()
{
$values = [];
if(!is_null($this->_occupancy)) {
$values[':occupancy'] = $this->_occupancy;
if(!is_null($this->occupancy)) {
$values[':occupancy'] = $this->occupancy;
}
if(!empty($this->_status)) {
$values[':status'] = implode(',', $this->_status);
if(!empty($this->status)) {
$values[':status'] = implode(',', $this->status);
}
return $values;
}
Expand Down Expand Up @@ -96,10 +96,10 @@ public function getAdditionalFields()
*/
public function setConfig($config)
{
$this->_occupancy = isset($config->occupancy) ? $config->occupancy: null;
$this->_status = isset($config->status) ? $config->status : null;
if(!is_array($this->_status)) {
$this->_status = [intval($this->_status)];
$this->occupancy = isset($config->occupancy) ? $config->occupancy: null;
$this->status = isset($config->status) ? $config->status : null;
if(!is_array($this->status)) {
$this->status = [intval($this->status)];
}
}

Expand All @@ -108,8 +108,8 @@ public function setConfig($config)
*/
public function getConfig() {
return [
'occupancy' => $this->_occupancy,
'status' => $this->_status
'occupancy' => $this->occupancy,
'status' => $this->status
];
}

Expand Down

0 comments on commit 336f825

Please sign in to comment.