public function sort($fieldName, $order = null) { return $this->addStage(new Stage\Sort($this, $fieldName, $order)); }
/** * {@inheritdoc} */ public function sort($fieldName, $order = null) { $fields = is_array($fieldName) ? $fieldName : [$fieldName => $order]; return parent::sort($this->getDocumentPersister()->prepareSortOrProjection($fields)); }