Returns a human friendly description of the filter used as label.
@param array $data filter settings
@return string active filter label
161684
public function get_label($data) {
        $operators      = $this->get_operators();
        $profilefields = $this->get_profile_fields();

        if (empty($profilefields)) {
            return '';
        }

        $profile  = $data['profile'];
        $operator = $data['operator'];
        $value    = $data['value'];

        if (!array_key_exists($profile, $profilefields)) {
            return '';
        }

        $a = new stdClass();
        $a->label    = $this->_label;
        $a->value    = $value;
        $a->profile  = $profilefields[$profile];
        $a->operator = $operators[$operator];

        switch($operator) {
            case 0: // Contains.
            case 1: // Doesn't contain.
            case 2: // Equal to.
            case 3: // Starts with.
            case 4: // Ends with.
                return get_string('profilelabel', 'filters', $a);
            case 5: // Empty.
            case 6: // Is not defined.
            case 7: // Is defined.
                return get_string('profilelabelnovalue', 'filters', $a);
        }
        return '';
    }
298647
public function getBindedLabel($row = [])
    {
        $bind = isset($row[$this->getName()]) ? $row[$this->getName()] : false;
        return sprintf($this->getLabel(), $bind);
    }
1078729
final private function convertToStatus(Array $data)
    {
        $statusMatrix = [
            'L' => 'Light',
            'ML' => 'Light to Moderate',
            'M' => 'Moderate',
            'MH' => 'Moderate to Heavy',
            'H' => 'Heavy'
        ];

        $status = [
            'NB' => [
                'name' => $data['NB'],
                'label' => $statusMatrix[$data['NB']] . ' Traffic',
                'last_updated' => $data['pubDate']
            ],
            'SB' => [
                'name' => $data['SB'],
                'label' => $statusMatrix[$data['SB']] . ' Traffic',
                'last_updated' => $data['pubDate']
            ]
        ];

        return $status;
    }
1232878
public function GetActiveValue()
    {
        $iValue = $this->aActiveFilterData;
        if (is_null($iValue) || ('0' != $iValue && '1' != $iValue)) {
            $iValue = '';
        }

        return $iValue;
    }
653470
private function getDataType($data)
    {
        if (is_string($data)) {
            return "'".$data."'";
        }

        if (is_numeric($data)) {
            return $data;
        }

        if (is_array($data)) {
            return 'Array';
        }

        if (is_bool($data)) {
            return $data ? 'true' : 'false';
        }

        if (is_object($data)) {
            return get_class($data);
        }

        if (is_null($data)) {
            return 'null';
        }

        return 'unknown';
    }
814163
protected function _filterData($data, array $filters)
    {
        $limit = false;
        if (isset($filters['limit'])) {
            $limit = $filters['limit'];
            unset($filters['limit']);
        }

        $filteredData = parent::_filterData($data, $filters);

        if ($limit) {
            if (is_array($limit)) {
                $filteredData = array_slice($filteredData, $limit[1], $limit[0]);
            } elseif (is_numeric($limit)) {
                $filteredData = array_slice($filteredData, 0, $limit);
            }
        }

        return $filteredData;
    }
1073650
protected function _format(array $data) {
		foreach (['id', 'rev'] as $key) {
			if (isset($data["_{$key}"])) {
				$data[$key] = $data["_{$key}"];
				unset($data["_{$key}"]);
			}
		}
		return $data;
	}
104478
protected function cleanFormData(array $data)
    {
        foreach ($data as $key => $value) {
            if (\is_array($value)) {
                $data[$key] = $this->cleanFormData($value);
            } elseif (\is_object($value)) {
                unset($data[$key]);
            }
        }

        return $data;
    }
904168
function filter($data = array())
    {
        if (! is_array($data)) {
            return $data;
        }
        // first apply the filters to the ROOT
        if (isset($this->filters[self::SELECTOR_ROOT])) {
            /* @var $rootFilters FilterSet */
            $rootFilters = $this->filters[self::SELECTOR_ROOT];
            $data = $rootFilters->applyFilters($data);
        }
        foreach ($data as $key => $value) {
            $data[$key] = $this->filterItem($data, $key);
        }
        return $data;
    }
40102
public function get_sql_filter($data) {
        static $counter = 0;
        $name = 'ex_simpleselect'.$counter++;

        $value = $data['value'];
        $params = array();
        $field = $this->_field;
        if ($value == '') {
            return '';
        }
        return array("$field=:$name", array($name => $value));
    }
493043
protected function createFilter(array $data = null)
    {
        $filter = new static();
        if ($data !== null) {
            $filter->setData($data);
        }
        return $filter;
    }
1041714
protected static function detectType(array $data)
    {
        foreach ([
                     self::TYPE_TEXT,
                     self::TYPE_AUDIO,
                     self::TYPE_DOCUMENT,
                     self::TYPE_GAME,
                     self::TYPE_PHOTO,
                     self::TYPE_STICKER,
                     self::TYPE_VIDEO,
                     self::TYPE_VOICE,
                     self::TYPE_CONTACT,
                     self::TYPE_LOCATION,
                     self::TYPE_VENUE,
                     self::TYPE_VIDEO_NOTE,
                     self::TYPE_NEW_CHAT_MEMBERS,
                     self::TYPE_LEFT_CHAT_MEMBER,
                     self::TYPE_NEW_CHAT_TITLE,
                     self::TYPE_NEW_CHAT_PHOTO,
                     self::TYPE_DELETE_CHAT_PHOTO,
                     self::TYPE_GROUP_CHAT_CREATED,
                     self::TYPE_SUPERGROUP_CHAT_CREATED,
                     self::TYPE_CHANNEL_CHAT_CREATED,
                     self::TYPE_MESSAGE_PINNED,
                     self::TYPE_INVOICE,
                     self::TYPE_SUCCESSFUL_PAYMENT,
                 ] as $type) {
            if (isset($data[$type])) {
                return $type;
            }
        }
        return static::TYPE_UNKNOWN;
    }
139652
public function getLabel()
    {
        if (property_exists($this, '_label_column')) {
            if (property_exists($this, $this->_label_column)) {
                $label_column = $this->_label_column;
                return $this->$label_column;
            }
        }
        if (property_exists($this, 'name')) {
            return $this->name;
        }
        if (property_exists($this, 'description')) {
            return $this->description;
        }
        return "No label for " . get_called_class() . " ID " . $this->getId();
    }
62747
public function GetActiveSettingAsArray()
    {
        $aData = array();
        if (is_array($this->aActiveFilterData) || !empty($this->aActiveFilterData)) {
            $aData = array(TdbPkgShopListfilterItem::URL_PARAMETER_FILTER_DATA => array($this->id => $this->aActiveFilterData));
        }

        return $aData;
    }
732382
public function filter(array $data)
    {
        $filteredData = [];

        foreach ($data as $value) {
            if ($this->match($value)) {
                $filteredData[] = $value;
            }
        }

        return $filteredData;
    }
1291144
protected function nameData($data = array())
    {
        return array(
            "ORDER_REF" => (isset($data[0])) ? $data[0] : 'N/A',
            "RESPONSE_CODE" => (isset($data[1])) ? $data[1] : 'N/A',
            "RESPONSE_MSG" => (isset($data[2])) ? $data[2] : 'N/A',
            "IDN_DATE" => (isset($data[3])) ? $data[3] : 'N/A',
            "ORDER_HASH" => (isset($data[4])) ? $data[4] : 'N/A',
        );
    }
855328
private function filterData(array $data)
    {
        $pattern = '/^' . str_replace('%', '.*', trim($this->likeExpr, "'")) . '$/';
        $newData = [];

        foreach ($data as $row) {
            if (preg_match($pattern, $row['Name'])) {
                $newData[] = $row;
            }
        }

        return $newData;
    }