Skip to content

Commit

Permalink
monitoring: Fix some of `DataView's PHPDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Fuhr committed Oct 7, 2014
1 parent a9ae75b commit fcc56c9
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions modules/monitoring/library/Monitoring/DataView/DataView.php
Expand Up @@ -7,7 +7,6 @@
use Countable;
use Icinga\Data\Filter\Filter;
use Icinga\Data\Filter\FilterMatch;
use Icinga\Data\SimpleQuery;
use Icinga\Data\Browsable;
use Icinga\Data\PivotTable;
use Icinga\Data\Sortable;
Expand All @@ -26,7 +25,7 @@ abstract class DataView implements Browsable, Countable, Filterable, Sortable
/**
* The query used to populate the view
*
* @var SimpleQuery
* @var \Icinga\Data\SimpleQuery
*/
private $query;

Expand All @@ -39,8 +38,8 @@ abstract class DataView implements Browsable, Countable, Filterable, Sortable
/**
* Create a new view
*
* @param SimpleQuery $query Which backend to query
* @param array $columns Select columns
* @param ConnectionInterface $connection
* @param array $columns
*/
public function __construct(ConnectionInterface $connection, array $columns = null)
{
Expand All @@ -64,17 +63,17 @@ public static function getQueryName()
return $tableName;
}

public function where($condition, $value = null)
{
$this->filter->addFilter(Filter::where($condition, $value));
$this->query->where($condition, $value);
return $this;
}
public function where($condition, $value = null)
{
$this->filter->addFilter(Filter::where($condition, $value));
$this->query->where($condition, $value);
return $this;
}

public function dump()
{
return $this->query->dump();
}
public function dump()
{
return $this->query->dump();
}

/**
* Retrieve columns provided by this view
Expand Down Expand Up @@ -194,9 +193,10 @@ public function pivot($xAxisColumn, $yAxisColumn)
* Sort the rows, according to the specified sort column and order
*
* @param string $column Sort column
* @param int $order Sort order, one of the SORT_ constants
* @param string $order Sort order, one of the SORT_ constants
*
* @return self
* @return $this
* @throws QueryException If the sort column is not allowed
* @see DataView::SORT_ASC
* @see DataView::SORT_DESC
* @deprecated Use DataView::order() instead
Expand Down Expand Up @@ -227,8 +227,8 @@ public function sort($column = null, $order = null)
};
}

$order = $order === null ? (isset($sortColumns['order']) ? $sortColumns['order'] : self::SORT_ASC) : $order;
$order = (strtoupper($order) === self::SORT_ASC) ? 'ASC' : 'DESC';
$order = $order === null ? (isset($sortColumns['order']) ? $sortColumns['order'] : static::SORT_ASC) : $order;
$order = (strtoupper($order) === static::SORT_ASC) ? 'ASC' : 'DESC';

foreach ($sortColumns['columns'] as $column) {
if (! $this->isValidFilterTarget($column)) {
Expand Down Expand Up @@ -260,7 +260,7 @@ public function getSortRules()
* @param string $column
* @param string $direction
*
* @return self
* @return $this
*/
public function order($column = null, $direction = null)
{
Expand Down Expand Up @@ -295,7 +295,7 @@ public function getMappedField($field)
/**
* Return the query which was created in the constructor
*
* @return mixed
* @return \Icinga\Data\SimpleQuery
*/
public function getQuery()
{
Expand Down

0 comments on commit fcc56c9

Please sign in to comment.