Gets all results from the database.

@param string $order - The order of the results

@return \Illuminate\Database\Query\Builder
432655
public function all($order = 'ASC')
    {
        $capsule = $this->_database->getCapsule();

        $this->_model = $capsule->table($this->table)->orderBy('id', $order)->get();

        return $this->_model;
    }
1080198
public function getFieldByOrder($order)
    {
        foreach ($this->_fields as $field) {
            if ($field instanceof FieldInterface) {
                if ($field->getOrder() == $order) {
                    return $field;
                }
            }
        }

        return null;
    }
1057895
public function getByOrderId($id)
    {
        $connection = $this->getConnection();
        $select     = $connection->select()->from($this->getMainTable())->where('order_id = :internal_order_id');
        $bind       = [':internal_order_id' => (string) $id];

        return $connection->fetchRow($select, $bind);
    }
724901
public static function findSome (int $limit=0, string $order="DESC")
	{
		$order = static::validateOrder($order);
		return static::limitFindBySql("SELECT * FROM ".static::$tableName." ORDER BY id {$order}", $limit);
	}
469963
public function get($table = '', $start = 0, $limit = 0, array $order = array(), array $where = array())
    {
        $parameters = array(
            'start' => $start,
            'limit' => $limit,
            'order' => $order,
            'where' => $where,
        );

        $parameters = array_filter($parameters);

        return $this->makeRequest($this->endpoint.'/'.$table, $parameters);
    }
244977
public function orderBy($order) 
    {
        
        $this->sql .= ' ORDER BY ';
        
        foreach($order as $column) {
            $this->sql .= $this->quoteColumnName($column[0]) .' '. $column[1] . ', ';
        }
        
        $this->sql = trim($this->sql, ', ');
        
        return $this;
    }
544300
public function findOrderCouponsByOrder(OrderInterface $order)
    {
        return $this
            ->createQueryBuilder('oc')
            ->where('oc.order = :order')
            ->setParameter('order', $order)
            ->getQuery()
            ->getResult();
    }
424885
public function getResults($sort = null)
    {
        $results = $this->results;

        if ($sort) {
            (strtolower($sort) == static::SORT_DESC) ? arsort($results) : asort($results);
        }

        return $results;
    }
487158
public function order($order, $type = 'DESC')
    {

        $this->string['order'] .= $this->useBuilder('order')
            ->order($order, $type);

        return $this;
    }
1210752
public function orderBy($columns, string $order = 'ASC')
	{
		$this->orderings[] =
		[
			'column' => is_array($columns) ? $columns : [$columns],
			'order'  => ($order === 'ASC' || $order === 'asc') ? 'ASC' : 'DESC',
		];

		return $this;
	}
88805
public function getItemsCollection($orderBy = 'updated_at', $order = 'desc')
    {
        if ($this->useSoftDeletes) {
            return $this->repository->withTrashed()->orderBy($orderBy, $order)->get();
        }

        return $this->repository->orderBy($orderBy, $order)->get();
    }
688191
public function get( $first = TRUE, $orders = array(), $limits = array() ){
		$this->validateFocus();
		$data = array();
		$conditions	= $this->getConditionQuery( array(), TRUE, TRUE, FALSE );						//  render WHERE clause if needed, cursored, without functions
		$orders		= $this->getOrderCondition( $orders );
		$limits		= $this->getLimitCondition( $limits );
		$columns	= $this->getColumnEnumeration( $this->columns );								//  get enumeration of masked column names
		$query		= 'SELECT '.$columns.' FROM '.$this->getTableName().' WHERE '.$conditions.$orders.$limits;

		$resultSet	= $this->dbc->query( $query );
		if( !$resultSet )
			return $first ? NULL : array();
		$resultList	= $resultSet->fetchAll( $this->getFetchMode() );
		if( $first )
			return $resultList ? $resultList[0] : NULL;
		return $resultList;
	}
307
public function selectAll($where=false, $order=false, $limit=false) {
        $clause = false;
        $values = array();
        if ( is_array($where) ) {
            $retval = self::extractWhere($where, $clause, $values);
            if ( is_string($retval) ) throw new \Exception($val);
        }
        $orderby = '';
        if ( is_string($order) ) {
            $orderby = self::extractOrder($order);
            if ( $orderby === false ) throw new \Exception('Invalid Order value');
        }

        $sql = "SELECT KVS.id AS id, json_body, KVS.created_at, KVS.updated_at
            FROM $this->KVS_TABLE AS KVS
            WHERE $this->KVS_FK_NAME = :foreign_key";
        if ( $clause ) $sql .= ' AND '.$clause;
        if ( $orderby ) $sql .= ' '.$orderby;
        $values[':foreign_key'] = $this->KVS_FK;
        $rows = $this->PDOX->allRowsDie($sql, $values);
        return $rows;
    }
902978
public static function getActiveCategories($order = [])
    {
        return self::find()
            ->select([
                'category_id',
                'slug',
                'image',
                'meta_title',
                'meta_description',
                'title',
                'h1',
                'description',
                'seotext',
                'param1',
                'param2',
                'param3',
                'videos_num',
                'on_index',
            ])
            ->where(['enabled' => 1])
            ->orderBy($order)
            ->asArray()
            ->all();
    }
1243431
public function select($where = null, $order = null)
    {
        if (!$this->isInitialized) {
            $this->initialize();
        }

        $select = $this->sql->select();

        if ($where instanceof \Closure) {
            $where($select);
        } elseif ($where !== null) {
            $select->where($where);
        }
        if ($order !== null) {
            $select->order($order);
        }

        return $this->selectWith($select);
    }
383028
public function orderBy(string $sort, string $order = 'ASC'): self
    {
        $order = 'ASC' === strtoupper($order) ? 'ASC' : 'DESC';
        $this->orderBy = [$sort => $order];
        return $this;
    }
628966
public function order($rule, $order = null){
		if($this->validateConditions())
			return $this;

		$this->resetState();

		if(is_array($rule) || $rule instanceof Traversable){
			foreach($rule as $key => $val){
				$this->order($key, $val);
			}
			return $this;
		}
		$this->sorting[] = array($rule, $order);

		return $this;
	}