forked from sstok/gush-experiments-sandbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FieldRegistryInterface.php
48 lines (43 loc) · 1.21 KB
/
FieldRegistryInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/*
* This file is part of the RollerworksSearch package.
*
* (c) Sebastiaan Stok <s.stok@rollerscapes.net>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Rollerworks\Component\Search;
/**
* @author Sebastiaan Stok <s.stok@rollerscapes.net>
*/
interface FieldRegistryInterface
{
/**
* Returns a field type by name.
*
* This methods registers the type extensions from the search extensions.
*
* @param string $name The name of the type
*
* @throws Exception\UnexpectedTypeException if the passed name is not a string
* @throws Exception\InvalidArgumentException if the type cannot be retrieved from any extension
*
* @return ResolvedFieldTypeInterface The type
*/
public function getType($name);
/**
* Returns whether the given field type is supported.
*
* @param string $name The name of the type
*
* @return bool Whether the type is supported
*/
public function hasType($name);
/**
* Returns the extensions loaded on the registry.
*
* @return SearchExtensionInterface[]
*/
public function getExtensions();
}