19 declare(strict_types=1);
47 $this->sort_and_save =
true;
51 public function asc(): self
53 $this->sort_direction = self::SORT_ASC;
57 public function desc(): self
59 $this->sort_direction = self::SORT_DESC;
66 return $this->
custom(
new ByTitle($this->resource_builder, $this->sort_direction));
71 return $this->
custom(
new BySize($this->resource_builder, $this->sort_direction));
82 $collection = $sorter->
sort($this->collection);
83 if ($this->sort_and_save) {
84 $this->collection_builder->store($collection);
__construct(protected ResourceBuilder $resource_builder, protected CollectionBuilder $collection_builder, protected ResourceCollection $collection)
custom(CollectionSorter $sorter)
sort(ResourceCollection $collection)
Class ResourceCollection.
Interface CollectionSorter.