/
EvolvableLinkInterface.zep
76 lines (68 loc) · 2.54 KB
/
EvolvableLinkInterface.zep
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/**
* This file is part of the Phalcon Framework.
*
* (c) Phalcon Team <team@phalcon.io>
*
* For the full copyright and license information, please view the LICENSE.txt
* file that was distributed with this source code.
*/
namespace Phalcon\Html\Link\Interfaces;
/**
* An evolvable link value object.
*/
interface EvolvableLinkInterface extends LinkInterface
{
/**
* Returns an instance with the specified href.
*
* @param string $href
* The href value to include. It must be one of:
* - An absolute URI, as defined by RFC 5988.
* - A relative URI, as defined by RFC 5988. The base of the relative
* link is assumed to be known based on context by the client.
* - A URI template as defined by RFC 6570.
* - An object implementing __toString() that produces one of the
* above values.
*
* An implementing library SHOULD evaluate a passed object to a string
* immediately rather than waiting for it to be returned later.
*/
public function withHref(string href) -> <EvolvableLinkInterface>;
/**
* Returns an instance with the specified relationship included.
*
* If the specified rel is already present, this method MUST return
* normally without errors, but without adding the rel a second time.
*
* @param string $rel The relationship value to add.
*/
public function withRel(string rel) -> <EvolvableLinkInterface>;
/**
* Returns an instance with the specified relationship excluded.
*
* If the specified rel is already not present, this method MUST return
* normally without errors.
*
* @param string $rel The relationship value to exclude.
*/
public function withoutRel(string rel) -> <EvolvableLinkInterface>;
/**
* Returns an instance with the specified attribute added.
*
* If the specified attribute is already present, it will be overwritten
* with the new value.
*
* @param string $attribute The attribute to include.
* @param string $value The value of the attribute to set.
*/
public function withAttribute(string attribute, string value) -> <EvolvableLinkInterface>;
/**
* Returns an instance with the specified attribute excluded.
*
* If the specified attribute is not present, this method MUST return
* normally without errors.
*
* @param string $attribute The attribute to remove.
*/
public function withoutAttribute(string attribute) -> <EvolvableLinkInterface>;
}