-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
476 additions
and
120 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Copyright (C) Ibexa AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Ibexa\Contracts\Search\Provider; | ||
|
||
interface ParentLocationProvider | ||
{ | ||
/** | ||
* @param array<int> $parentLocationIds | ||
* | ||
* @return array<\Ibexa\Search\Model\Suggestion\ParentLocation> | ||
*/ | ||
public function provide(array $parentLocationIds): array; | ||
} |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Copyright (C) Ibexa AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Ibexa\Search\Model\Suggestion; | ||
|
||
final class ParentLocation | ||
{ | ||
private int $contentId; | ||
|
||
private int $locationId; | ||
|
||
private string $name; | ||
|
||
public function __construct(int $contentId, int $locationId, string $name) | ||
{ | ||
$this->contentId = $contentId; | ||
$this->locationId = $locationId; | ||
$this->name = $name; | ||
} | ||
|
||
public function getContentId(): int | ||
{ | ||
return $this->contentId; | ||
} | ||
|
||
public function getLocationId(): int | ||
{ | ||
return $this->locationId; | ||
} | ||
|
||
public function getName(): string | ||
{ | ||
return $this->name; | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Copyright (C) Ibexa AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Ibexa\Search\Model\Suggestion; | ||
|
||
use Ibexa\Contracts\Core\Collection\MutableArrayList; | ||
use Ibexa\Contracts\Core\Exception\InvalidArgumentException; | ||
use Ibexa\Contracts\Search\Model\Suggestion\Suggestion; | ||
|
||
/** | ||
* @template-extends \Ibexa\Contracts\Core\Collection\MutableArrayList<\Ibexa\Search\Model\Suggestion\ParentLocation> | ||
*/ | ||
final class ParentLocationCollection extends MutableArrayList | ||
{ | ||
/** | ||
* @param mixed $item | ||
*/ | ||
public function append($item): void | ||
{ | ||
if (!$item instanceof ParentLocation) { | ||
throw new InvalidArgumentException( | ||
'$item', | ||
sprintf( | ||
'Argument 1 passed to %s::append() must be an instance of %s, %s given', | ||
__CLASS__, | ||
Suggestion::class, | ||
\is_object($item) ? \get_class($item) : \gettype($item) | ||
) | ||
); | ||
} | ||
|
||
parent::append($item); | ||
} | ||
} |
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
Oops, something went wrong.