Sets the direction to return the log entries in.

@param  string  $field
@param  string  $direction

@return \Jackiedo\LogReader\LogReader
970804
public function orderBy($field, $direction = 'asc')
    {
        $this->setOrderByField($field);
        $this->setOrderByDirection($direction);

        return $this;
    }
30710
public function setDirection($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Firestore\V1beta1\StructuredQuery_Direction::class);
        $this->direction = $var;

        return $this;
    }
111503
public function OrderBy($Fields, $Direction = 'asc') {
      if (!$Fields)
         return $this;
         
      if ($Direction && $Direction != 'asc')
         $Direction = 'desc';
      else
         $Direction = 'asc';

      $this->_OrderBys[] = $this->EscapeIdentifier($Fields, TRUE).' '.$Direction;
      return $this;
   }
494492
protected function _order($fields)
    {
        $direction = 'ASC';

        $result = [];
        foreach ($fields as $field => $value) {
            if (!is_int($field)) {
                $result[$field] = $value;
                continue;
            }
            if (preg_match('/^(.*?)\s+((?:a|de)sc)$/i', $value, $match)) {
                $value = $match[1];
                $dir = $match[2];
            } else {
                $dir = $direction;
            }
            $result[$value] = $dir;
        }
        return $result;
    }
1239861
public function sortBy($fieldName, $direction = null)
	{
		$predefinedFields = $this->get('sort');
		$sortingFields = [];

		// Field exists, prioritize and set direction (if any).
		if ($field = $this->findField($fieldName, $predefinedFields)) {
			// Field was defined without options.
			if (!is_array($field)) {
				if ($direction) {
					$sortingFields[] = [$fieldName => $direction];
				} else {
					$sortingFields[] = $fieldName;
				}
			} else {
				// Set direction, otherwise it will just use the default definition.
				if ($direction) {
					// Defined as {"post_date" : {"order" : "asc", "mode": "avg"}}
					if (is_array($field[$fieldName])) {
						$field[$fieldName]['order'] = $direction;
					} // Defined as {"post_date" : "asc"}
					else {
						$field[$fieldName] = $direction;
					}
				}
				$sortingFields[] = $field;
			}
		} // Field does not exist, add it.
		else {
			$sortingFields[] = [$fieldName => $direction];
		}

		// Add the predefined fields but remove the one we are sorting on.
		if ($predefinedFields) {
			foreach ($predefinedFields as $field) {
				if (!is_array($field) && $fieldName == $field) {
					continue;
				} elseif (is_array($field) && array_key_exists($fieldName, $field)) {
					continue;
				}

				$sortingFields[] = $field;
			}
		}

		$this->set('sort', $sortingFields);

		return $this;
	}
637591
public function sortByProperty( $property, $direction = null )
    {
        $this->sort( $this->generateSortByPropertyClosure( $property, $direction ) );
        return $this;
    }
77129
public function orderBy($column, $direction = 'ASC')
    {
        $this->ordering[$this->applyTableAlias($column)] = $direction;

        return $this;
    }
265540
public function setOrderDirection($direction)
    {

        $direction = strtolower($direction);

        if (!in_array($direction, ['asc', 'desc'])) {
            throw new \InvalidArgumentException('$direction must be "asc" or "desc"');
        }

        $this->orderDirection = $direction;
        return $this;
    }
434490
protected function adjustLines(array $lines, $direction)
    {
        $adjust_method = 'adjust' . ucwords(strtolower($direction))  . 'Lines';

        if (method_exists($this, $adjust_method)) {
            return $this->$adjust_method($lines);
        }

        return $lines;
    }
75621
public function orderBy($field, $direction = 1)
    {
        if (is_string($direction)) {
            $direction = $direction === 'asc' ? 1 : -1;
        }

        $this->orderBy[$field] = $direction;

        return $this;
    }
45489
public function groupBy($fields, $direction = false)
    {
        $this->groupBy->addFields($fields, $direction);

        return $this;
    }
1325794
public function orderBy($column, $direction = 'asc')
    {
        return $this->order($this->mapper->getFilterPropertyName($column), $direction);
    }
707440
public function orderBy($column, $direction = Table::ORDER_ASC) {
        $this->orderBy[] = '`' . Util::camelTo_($column) . '` ' . $direction;
        return $this;
    }
862619
public function sortField($field, $direction = SORT_ASC, $sortFlag = SORT_NUMERIC)
    {
        // check array
        if (!$this->isArray($this->first()->val())) {
            throw new ArrayObjectException(ArrayObjectException::MSG_MULTIDIM_SORT);
        }

        // check if key is present in the array
        if (!$this->first()->key($field)) {
            throw new ArrayObjectException(ArrayObjectException::MSG_VALUE_NOT_PRESENT, [
                '$field',
                'the current array'
            ]);
        }

        // do the sorting
        $tempArray = array();
        $thisArray = $this->val();

        foreach ($thisArray as $mk => $m) {
            $tempArray[$m[$field]][] = $mk;
        }

        if ($direction == SORT_DESC) {
            krsort($tempArray, $sortFlag);
        } else {
            ksort($tempArray, $sortFlag);
        }

        $newArray = array();
        foreach ($tempArray as $tk => $tv) {
            foreach ($tv as $ttk => $ttv) {
                $newArray[$ttv] = $thisArray[$ttv];
            }
        }

        $this->val($newArray);
        unset($tempArray);
        unset($thisArray);

        return $this;
    }
919506
public static function lastChangeComparator(int $direction = 1): Closure
    {
        return static function (GedcomRecord $x, GedcomRecord $y) use ($direction): int {
            return $direction * ($x->lastChangeTimestamp() <=> $y->lastChangeTimestamp());
        };
    }
1123178
public function setField($field)
    {
        if(is_string($field)) {
            $field = new FieldIdentifier($field);
        }
        $this->field = $field;
        return $this;
    }
456469
public function orderBy($fields, string $direction = 'ASC'): IQueryBuilderHandler
    {
        if (\is_array($fields) === false) {
            $fields = [$fields];
        }

        foreach ((array)$fields as $key => $value) {
            $field = $key;
            $type = $value;

            if (\is_int($key) === true) {
                $field = $value;
                $type = $direction;
            }

            if (($field instanceof Raw) === false) {
                $field = $this->addTablePrefix($field);
            }

            $this->statements['orderBys'][] = compact('field', 'type');
        }

        return $this;
    }