-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Maxence Lange <[email protected]>
- Loading branch information
1 parent
3685bf8
commit 447618c
Showing
15 changed files
with
221 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
/** | ||
* @copyright Copyright (c) 2017 Robin Appelman <[email protected]> | ||
* | ||
* @author Maxence Lange <[email protected]> | ||
* @author Robin Appelman <[email protected]> | ||
* | ||
* @license GNU AGPL version 3 or any later version | ||
|
@@ -26,36 +27,36 @@ | |
use OCP\Files\Search\ISearchOrder; | ||
|
||
class SearchOrder implements ISearchOrder { | ||
/** @var string */ | ||
private $direction; | ||
/** @var string */ | ||
private $field; | ||
|
||
/** | ||
* SearchOrder constructor. | ||
* | ||
* @param string $direction | ||
* @param string $field | ||
*/ | ||
public function __construct($direction, $field) { | ||
$this->direction = $direction; | ||
$this->field = $field; | ||
public function __construct( | ||
private string $direction, | ||
private string $field, | ||
private string $extra = '' | ||
) { | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getDirection() { | ||
public function getDirection(): string { | ||
return $this->direction; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getField() { | ||
public function getField(): string { | ||
return $this->field; | ||
} | ||
|
||
public function getExtra(): string { | ||
return $this->extra; | ||
} | ||
|
||
public function isExtra(): bool { | ||
return ($this->extra !== ''); | ||
} | ||
|
||
public function sortFileInfo(FileInfo $a, FileInfo $b): int { | ||
$cmp = $this->sortFileInfoNoDirection($a, $b); | ||
return $cmp * ($this->direction === ISearchOrder::DIRECTION_ASCENDING ? 1 : -1); | ||
|
Oops, something went wrong.