Returns all the data from the selected column
@param String $filter
@param array $columns
@return Array
11249
public function getDataForExport($filter, $columns = array())
	{
        $select = $this->tableGateway->getSql()->select();
        $select->columns(array('*'));
        
        $w = new Where();
        $filters = array();
        $likes = array();
        
        foreach($columns as $columnKeys) 
        {
            $likes[] = new Like($columnKeys, '%'.$filter.'%');
        }
        
        $filters = array(new PredicateSet($likes, PredicateSet::COMBINED_BY_OR));
        
        $select->where($filters);
        
        $resultSet = $this->tableGateway->selectWith($select);
        
        return $resultSet;
        
	}
954947
public function get_filter_values($filter) {
        if ($allvalues = (array) $this->get_config('filtervalues')) {
            if (isset($allvalues[$filter])) {
                return $allvalues[$filter];
            }
        }

        return [];
    }
205246
protected function getSelectColumns( $columns = null )
    {
        if ( null === $columns )
        {
            $proxyData = true;
        }
        elseif ( ( $index = array_search( 'proxyData', $columns ) ) )
        {
            $proxyData = true;
            unset( $columns[$index] );
        }
        else
        {
            $proxyData = false;
        }

        if ( null === $columns )
        {
            $tags = true;
        }
        elseif ( ( $index = array_search( 'tags', $columns ) ) )
        {
            $tags = true;
            unset( $columns[$index] );
        }
        else
        {
            $tags = false;
        }

        if ( null === $columns )
        {
            $tagIds = true;
        }
        elseif ( ( $index = array_search( 'tagIds', $columns ) ) )
        {
            $tagIds = true;
            unset( $columns[$index] );
        }
        else
        {
            $tagIds = false;
        }

        if ( null === $columns )
        {
            $localeTags = true;
        }
        elseif ( ( $index = array_search( 'localeTags', $columns ) ) )
        {
            $localeTags = true;
            unset( $columns[$index] );
        }
        else
        {
            $localeTags = false;
        }

        $columns  = parent::getSelectColumns( $columns );
        $platform = $this->getDbAdapter()
                         ->getPlatform();

        if ( $proxyData )
        {
            $columns['proxyData'] = new Sql\Expression( '(' .
                $this->sql( $this->getTableInSchema(
                        static::$propertyTableName
                     ) )
                     ->select()
                     ->columns( array(
                         new Sql\Expression( 'TEXT( ARRAY_TO_JSON(
                             ARRAY_AGG(
                                 ?
                                 ORDER BY CASE ?
                                    WHEN ? THEN 1
                                    WHEN ? THEN 2
                                    WHEN ? THEN 3
                                    WHEN ? THEN 4
                                    ELSE 5
                                 END DESC
                             )
                         ) )', array(
                             static::$propertyTableName,
                             'locale',
                             $this->getLocale(),
                             $this->getPrimaryLanguage(),
                             $this->getDefaultLocale(),
                             'en',
                         ), array(
                             Sql\Expression::TYPE_IDENTIFIER,
                             Sql\Expression::TYPE_IDENTIFIER,
                             Sql\Expression::TYPE_VALUE,
                             Sql\Expression::TYPE_VALUE,
                             Sql\Expression::TYPE_VALUE,
                             Sql\Expression::TYPE_VALUE,
                         ) ),
                     ) )
                     ->where( array(
                         new Sql\Predicate\Operator(
                             static::$propertyTableName . '.paragraphId',
                             Sql\Predicate\Operator::OPERATOR_EQUAL_TO,
                             static::$tableName . '.id',
                             Sql\Predicate\Operator::TYPE_IDENTIFIER,
                             Sql\Predicate\Operator::TYPE_IDENTIFIER
                         ),
                     ) )
                     ->getSqlString( $platform ) .
            ')' );
        }
        else
        {
            $original = array_keys( static::getColumns() ) + array(
                'tags', 'tagIds', 'localeTags',
            );

            foreach ( $columns as $key => $column )
            {
                if ( is_numeric( $key ) && ! in_array( $column, $original ) )
                {
                    unset( $columns[$key] );

                    if ( ! isset( $columns[$column] ) )
                    {
                        $columns[$column] = new Sql\Expression( '(' .
                            $this->sql( $this->getTableInSchema(
                                     static::$propertyTableName
                                 ) )
                                 ->select()
                                 ->columns( array( 'value' ) )
                                 ->where( array(
                                     new Sql\Predicate\Operator(
                                         static::$propertyTableName . '.paragraphId',
                                         Sql\Predicate\Operator::OPERATOR_EQUAL_TO,
                                         static::$tableName . '.id',
                                         Sql\Predicate\Operator::TYPE_IDENTIFIER,
                                         Sql\Predicate\Operator::TYPE_IDENTIFIER
                                     ),
                                     'name' => $column,
                                 ) )
                                 ->order( array(
                                     new Sql\Expression(
                                         'CASE ? ' .
                                             'WHEN ? THEN 1 ' .
                                             'WHEN ? THEN 2 ' .
                                             'WHEN ? THEN 3 ' .
                                             'ELSE 4 ' .
                                         'END ASC',
                                         array(
                                             'locale',
                                             $this->getLocale(),
                                             $this->getPrimaryLanguage(),
                                             '*',
                                         ),
                                         array(
                                             Sql\Expression::TYPE_IDENTIFIER,
                                             Sql\Expression::TYPE_VALUE,
                                             Sql\Expression::TYPE_VALUE,
                                             Sql\Expression::TYPE_VALUE,
                                         )
                                     ),
                                 ) )
                                 ->limit( 1 )
                                 ->getSqlString( $platform ) .
                        ')' );
                    }
                }
            }
        }

        if ( $tags )
        {
            $columns['tags'] = new Sql\Expression( '(' .
                $this->sql( $this->getTableInSchema(
                        static::$tagTableName
                     ) )
                     ->select()
                     ->columns( array(
                         new Sql\Expression(
                             'STRING_AGG( ?, ? ORDER BY ? ASC )',
                             array(
                                 'name',
                                 static::TAG_SEPARATOR,
                                 'name',
                             ),
                             array(
                                 Sql\Expression::TYPE_IDENTIFIER,
                                 Sql\Expression::TYPE_VALUE,
                                 Sql\Expression::TYPE_IDENTIFIER,
                             )
                         ),
                     ) )
                     ->join(
                         $this->getTableInSchema( static::$tagJoinTableName ),
                         static::$tagTableName . '.id = ' .
                         static::$tagJoinTableName . '.tagId',
                         array()
                     )
                     ->where( array(
                         new Sql\Predicate\Operator(
                             static::$tagJoinTableName . '.paragraphId',
                             Sql\Predicate\Operator::OPERATOR_EQUAL_TO,
                             static::$tableName . '.id',
                             Sql\Predicate\Operator::TYPE_IDENTIFIER,
                             Sql\Predicate\Operator::TYPE_IDENTIFIER
                         ),
                     ) )
                     ->getSqlString( $platform ) .
            ')' );
        }

        if ( $tagIds )
        {
            $columns['tagIds'] = new Sql\Expression( '(' .
                $this->sql( $this->getTableInSchema(
                        static::$tagJoinTableName
                     ) )
                     ->select()
                     ->columns( array(
                         new Sql\Expression(
                             'STRING_AGG( TEXT( ? ), ? ORDER BY ? ASC )',
                             array(
                                 'tagId',
                                 static::TAG_SEPARATOR,
                                 'tagId',
                             ),
                             array(
                                 Sql\Expression::TYPE_IDENTIFIER,
                                 Sql\Expression::TYPE_VALUE,
                                 Sql\Expression::TYPE_IDENTIFIER,
                             )
                         ),
                     ) )
                     ->where( array(
                         new Sql\Predicate\Operator(
                             static::$tagJoinTableName . '.paragraphId',
                             Sql\Predicate\Operator::OPERATOR_EQUAL_TO,
                             static::$tableName . '.id',
                             Sql\Predicate\Operator::TYPE_IDENTIFIER,
                             Sql\Predicate\Operator::TYPE_IDENTIFIER
                         ),
                     ) )
                     ->getSqlString( $platform ) .
            ')' );
        }

        if ( $localeTags )
        {
            $columns['localeTags'] = new Sql\Expression( '(' .
                $this->sql( $this->getTableInSchema(
                        static::$tagTableName
                     ) )
                     ->select()
                     ->columns( array(
                         new Sql\Expression(
                             'STRING_AGG( ?, ? ORDER BY ? ASC )',
                             array(
                                 'name',
                                 static::TAG_SEPARATOR,
                                 'name',
                             ),
                             array(
                                 Sql\Expression::TYPE_IDENTIFIER,
                                 Sql\Expression::TYPE_VALUE,
                                 Sql\Expression::TYPE_IDENTIFIER,
                             )
                         ),
                     ) )
                     ->join(
                         $this->getTableInSchema( static::$tagJoinTableName ),
                         static::$tagTableName . '.id = ' .
                         static::$tagJoinTableName . '.tagId',
                         array()
                     )
                     ->where( array(
                         new Sql\Predicate\Operator(
                             static::$tagJoinTableName . '.paragraphId',
                             Sql\Predicate\Operator::OPERATOR_EQUAL_TO,
                             static::$tableName . '.id',
                             Sql\Predicate\Operator::TYPE_IDENTIFIER,
                             Sql\Predicate\Operator::TYPE_IDENTIFIER
                         ),
                         new Sql\Predicate\PredicateSet(
                             array(
                                 new Sql\Predicate\IsNull(
                                     static::$tagTableName . '.locale'
                                 ),
                                 new Sql\Predicate\In(
                                     static::$tagTableName . '.locale',
                                     array(
                                         $this->getLocale(),
                                         $this->getPrimaryLanguage(),
                                         '',
                                     )
                                 ),
                             ),
                             Sql\Predicate\PredicateSet::COMBINED_BY_OR
                         ),
                     ) )
                     ->getSqlString( $platform ) .
            ')' );
        }

        return $columns;
    }
883981
public function getAll(array $filter)
    {
        $this->select = $this->readSql->select('history');
                    
        $this->joinAuth()->joinAclRole();
        
        $this->filter($filter)->sort($filter); 

        if (array_key_exists('pagination', $filter)) {
            if ($filter['pagination'] == 'off') {  
                return $this->getRows();    
            }
        }

        return $this->getPaginator();
    }
1055581
public function select(string $column, string ...$columns)
    {
        $instance = $this->selectQueryInstance();

        $instance->selectQuery()->columns($column, ...$columns);

        return $instance;
    }
36823
public function select($columns = [])
    {
        $expr = new ColumnExpression($this->getSQLStatement());

        if ($columns instanceof Closure) {
            $columns($expr);
        } else {
            if (!is_array($columns)) {
                $columns = [$columns];
            }
            $expr->columns($columns);
        }
    }
105353
protected function getDataByColumn($data, $columns)
    {
        if (is_string($columns)) {
            return array_get($data, $columns);
        }

        if (is_array($columns)) {
            $value = [];
            foreach ($columns as $name => $column) {
                if (!array_has($data, $column)) {
                    continue;
                }
                $value[$name] = array_get($data, $column);
            }

            return $value;
        }
    }
907821
public function get($columns = ['*'])
    {
        $original = $this->columns;

        if (is_null($original)) {
            $this->columns = $columns;
        }

        $results = $this->runSelect();

        $this->columns = $original;

        return $results;
    }
106282
protected function getSelectColumns( $columns = null )
    {
        if ( null === $columns )
        {
            $label = true;
        }
        elseif ( ( $index = array_search( 'label', $columns ) ) )
        {
            $label = true;
            unset( $columns[$index] );
        }
        else
        {
            $label = false;
        }

        if ( null === $columns )
        {
            $proxyData = true;
        }
        elseif ( ( $index = array_search( 'proxyData', $columns ) ) )
        {
            $proxyData = true;
            unset( $columns[$index] );
        }
        else
        {
            $proxyData = false;
        }

        if ( null === $columns )
        {
            $level = false;
        }
        elseif ( ( $index = array_search( 'level', $columns ) ) )
        {
            $level = true;
            unset( $columns[$index] );
        }
        else
        {
            $level = false;
        }

        $columns = parent::getSelectColumns( $columns );

        if ( $label )
        {
            $platform = $this->getDbAdapter()
                             ->getPlatform();

            $columns['label'] = new Sql\Expression( '(' .
                $this->sql( $this->getTableInSchema(
                        static::$labelTableName
                     ) )
                     ->select()
                     ->columns( array( 'label' ) )
                     ->where( array(
                         new Sql\Predicate\Expression(
                             $platform->quoteIdentifierChain( array(
                                 static::$labelTableName, 'menuId'
                             ) ) .
                             ' = ' .
                             $platform->quoteIdentifierChain( array(
                                 static::$tableName, 'id'
                             ) )
                         )
                     ) )
                     ->order( array(
                         new Sql\Expression(
                             'CASE ? ' .
                                 'WHEN ? THEN 1 ' .
                                 'WHEN ? THEN 2 ' .
                                 'WHEN ? THEN 3 ' .
                                 'WHEN ? THEN 4 ' .
                                 'ELSE 5 ' .
                             'END ASC',
                             array(
                                 'locale',
                                 $this->getLocale(),
                                 $this->getPrimaryLanguage(),
                                 $this->getDefaultLocale(),
                                 'en',
                             ),
                             array(
                                 Sql\Expression::TYPE_IDENTIFIER,
                                 Sql\Expression::TYPE_VALUE,
                                 Sql\Expression::TYPE_VALUE,
                                 Sql\Expression::TYPE_VALUE,
                                 Sql\Expression::TYPE_VALUE,
                             )
                         ),
                     ) )
                     ->limit( 1 )
                     ->getSqlString( $platform ) .
            ')' );
        }

        if ( $proxyData )
        {
            $platform = $this->getDbAdapter()
                             ->getPlatform();

            $columns['proxyData'] = new Sql\Expression( '(' .
                $this->sql( $this->getTableInSchema(
                        static::$propertyTableName
                     ) )
                     ->select()
                     ->columns( array(
                         new Sql\Expression( 'TEXT( ARRAY_TO_JSON(
                             ARRAY_AGG( ? ORDER BY ? ASC )
                         ) )', array(
                             static::$propertyTableName,
                             'name',
                         ), array(
                             Sql\Expression::TYPE_IDENTIFIER,
                             Sql\Expression::TYPE_IDENTIFIER,
                         ) )
                     ) )
                     ->where( array(
                         new Sql\Predicate\Expression(
                             $platform->quoteIdentifierChain( array(
                                 static::$propertyTableName, 'menuId'
                             ) ) .
                             ' = ' .
                             $platform->quoteIdentifierChain( array(
                                 static::$tableName, 'id'
                             ) )
                         )
                     ) )
                     ->getSqlString( $platform ) .
            ')' );
        }

        if ( $level )
        {
            $columns['level'] = new Sql\Expression( '(' .
                $this->sql( null )
                     ->select( array(
                         'ascendants' => static::$tableName,
                     ) )
                     ->columns( array( new Sql\Expression( 'COUNT(*) - 1' ) ) )
                     ->where( array(
                         new Sql\Predicate\Expression(
                             $platform->quoteIdentifierChain( array(
                                 static::$tableName, 'left'
                             ) ) .
                             ' BETWEEN ' .
                             $platform->quoteIdentifierChain( array(
                                 'ascendants', 'left'
                             ) ) .
                             ' AND ' .
                             $platform->quoteIdentifierChain( array(
                                 'ascendants', 'right'
                             ) )
                         )
                     ) )
                     ->getSqlString( $platform ) .
            ')' );
        }

        return $columns;
    }
1197780
public function select($columns = [])
    {
        $columns = is_array($columns) ? $columns : func_get_args();

        if (! empty($columns)) {
            $this->columns = $columns;
        }

        return $this;
    }
1190725
protected function fetchColumnValue($data, $columns)
    {
        if (is_string($columns)) {
            return Arr::get($data, $columns);
        }

        if (is_array($columns)) {
            $value = [];
            foreach ($columns as $name => $column) {
                if (!Arr::has($data, $column)) {
                    continue;
                }
                $value[$name] = Arr::get($data, $column);
            }

            return $value;
        }
    }
859676
public function get($columns = ['*']) {
        if (count($columns) === 1 && isset($columns[0]) && $columns[0] === '*' && !empty($this->query->selects)) {
            return $this->query->all();
        }
        return $this->query->select($columns)->all();
    }
993870
public function getHlblocks($filter = array()) {
        $dbres = HL\HighloadBlockTable::getList(
            array(
                'select' => array('*'),
                'filter' => $filter,
            )
        );

        $result = [];
        while ($hlblock = $dbres->fetch()) {
            $hlblock['LANG'] = $this->getHblockLangs($hlblock['ID']);
            $result[] = $hlblock;
        }

        return $result;
    }
267231
function select($fields,$filter=NULL,array $options=NULL,$ttl=0) {
		list($sql,$args)=$this->stringify($fields,$filter,$options);
		$result=$this->db->exec($sql,$args,$ttl);
		$out=[];
		foreach ($result as &$row) {
			foreach ($row as $field=>&$val) {
				if (array_key_exists($field,$this->fields)) {
					if (!is_null($val) || !$this->fields[$field]['nullable'])
						$val=$this->db->value(
							$this->fields[$field]['pdo_type'],$val);
				}
				unset($val);
			}
			$out[]=$this->factory($row);
			unset($row);
		}
		return $out;
	}
1245793
public function orWhereNotIn($column, $values, $filter = false)
    {
        return $this->whereInValues(__FUNCTION__, $column, $values, $filter);
    }
1051983
public static function filterRecords(array $records, $filter)
    {
        if (is_string($filter))
        {
            $filter = new PropertyFilter($filter);
        }

        $result = [ ];
        foreach ($records as $record)
        {
            if ($filter->match($record))
            {
                $result[$record->getId()] = $record;
            }
        }

        return $result;
    }
852864
protected function convertToArray($data, $filter = 'raw')
    {
        $array = [];

        foreach ($data as $key => $value) {
            if (is_array($value)) {
                $array[$key] = $this->convertToArray($value);
            } else {
                $array[$key] = $this->filter->clean($value, $filter);
            }
        }

        return $array;
    }