Skip to content

Commit

Permalink
Merge b3de798 into 06ae939
Browse files Browse the repository at this point in the history
  • Loading branch information
unrealevil committed Mar 31, 2021
2 parents 06ae939 + b3de798 commit 58edf4e
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions Grid/Column/Column.php
Expand Up @@ -14,7 +14,6 @@

use APY\DataGridBundle\Grid\Filter;
use APY\DataGridBundle\Grid\Row;
use Doctrine\Common\Version as DoctrineVersion;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;

abstract class Column
Expand Down Expand Up @@ -213,7 +212,7 @@ public function renderCell($value, $row, $router)

$value = is_bool($value) ? (int) $value : $value;
if (array_key_exists((string) $value, $this->values)) {
$value = $this->values[$value];
$value = $this->values[(string) $value];
}

return $value;
Expand Down Expand Up @@ -525,6 +524,10 @@ public function setData($data)
*/
public function getData()
{
if (!\is_array($this->data)){
return [];
}

$result = [];

$hasValue = false;
Expand Down Expand Up @@ -685,6 +688,10 @@ public function getFilterType()

public function getFilters($source)
{
if (!\is_array($this->data)) {
return [];
}

$filters = [];

if ($this->hasOperator($this->data['operator'])) {
Expand Down Expand Up @@ -769,21 +776,6 @@ public function setOperators(array $operators)
*/
public function getOperators()
{
// Issue with Doctrine
// -------------------
// @see http://www.doctrine-project.org/jira/browse/DDC-1857
// @see http://www.doctrine-project.org/jira/browse/DDC-1858
if ($this->hasDQLFunction() && version_compare(DoctrineVersion::VERSION, '2.5') < 0) {
return array_intersect($this->operators, [self::OPERATOR_EQ,
self::OPERATOR_NEQ,
self::OPERATOR_LT,
self::OPERATOR_LTE,
self::OPERATOR_GT,
self::OPERATOR_GTE,
self::OPERATOR_BTW,
self::OPERATOR_BTWE, ]);
}

return $this->operators;
}

Expand Down

0 comments on commit 58edf4e

Please sign in to comment.