orderBy = $orderBy; $this->order = $order; } /** * @param SearchParams::ORDER_ASC|SearchParams::ORDER_DESC|null $order */ public static function create(string $orderBy, ?string $order = null): self { if ($order === null) { $order = SearchParams::ORDER_ASC; } return new self($orderBy, $order); } /** * Get a field. */ public function getOrderBy(): string { return $this->orderBy; } /** * Get a direction. * * @return SearchParams::ORDER_ASC|SearchParams::ORDER_DESC */ public function getOrder(): string { return $this->order; } }