1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Hateoas\Tests\Fixtures; |
4
|
|
|
|
5
|
|
|
use Hateoas\Configuration\Annotation as Hateoas; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* @Hateoas\Relation("self", href = "http://hateoas.web/user/42", attributes = {"type" = "application/json"}) |
9
|
|
|
* @Hateoas\Relation("foo", href = @Hateoas\Route("user_get", parameters = {"id" = "expr(object.getId())"}), embedded = "expr(object.getFoo())") |
10
|
|
|
* @Hateoas\Relation("bar", href = "foo", embedded = @Hateoas\Embedded("data", xmlElementName = "barTag")) |
11
|
|
|
* @Hateoas\Relation("baz", href = @Hateoas\Route("user_get", parameters = {"id" = "expr(object.getId())"}, absolute = true), embedded = "expr(object.getFoo())") |
12
|
|
|
* @Hateoas\Relation("boom", href = @Hateoas\Route("user_get", parameters = {"id" = "expr(object.getId())"}, absolute = false), embedded = "expr(object.getFoo())") |
13
|
|
|
* @Hateoas\Relation("badaboom", embedded = "expr(object.getFoo())") |
14
|
|
|
* @Hateoas\Relation( |
15
|
|
|
* "hello", |
16
|
|
|
* href = "/hello", |
17
|
|
|
* exclusion = @Hateoas\Exclusion( |
18
|
|
|
* groups = {"group1", "group2"}, |
19
|
|
|
* sinceVersion = 1, |
20
|
|
|
* untilVersion = 2.2, |
21
|
|
|
* maxDepth = 42, |
22
|
|
|
* excludeIf = "foo" |
23
|
|
|
* ), |
24
|
|
|
* embedded = @Hateoas\Embedded( |
25
|
|
|
* "hello", |
26
|
|
|
* xmlElementName = "barTag", |
27
|
|
|
* exclusion = @Hateoas\Exclusion( |
28
|
|
|
* groups = {"group3", "group4"}, |
29
|
|
|
* sinceVersion = 1.1, |
30
|
|
|
* untilVersion = 2.3, |
31
|
|
|
* maxDepth = 43, |
32
|
|
|
* excludeIf = "bar" |
33
|
|
|
* ) |
34
|
|
|
* ) |
35
|
|
|
* ) |
36
|
|
|
* |
37
|
|
|
* @Hateoas\RelationProvider("getRelations") |
38
|
|
|
*/ |
39
|
|
|
class User |
40
|
|
|
{ |
41
|
|
|
// do not use for functional testing |
42
|
|
|
} |
43
|
|
|
|