1 | <?php |
||
16 | abstract class AbstractResource implements ResourceInterface |
||
17 | { |
||
18 | use LinksTrait, SelfLinkTrait, MetaTrait; |
||
19 | |||
20 | /** |
||
21 | * The resource type. |
||
22 | * |
||
23 | * @var string |
||
24 | */ |
||
25 | protected $type; |
||
26 | |||
27 | /** |
||
28 | * {@inheritdoc} |
||
29 | */ |
||
30 | 3 | public function getType() |
|
34 | |||
35 | /** |
||
36 | * {@inheritdoc} |
||
37 | */ |
||
38 | 3 | public function getAttributes(array $fields = null) |
|
42 | |||
43 | /** |
||
44 | * Get the links. |
||
45 | * |
||
46 | * @return array |
||
47 | */ |
||
48 | public function getLinks() |
||
52 | |||
53 | /** |
||
54 | * Get the meta data. |
||
55 | * |
||
56 | * @return array |
||
57 | */ |
||
58 | 3 | public function getMeta() |
|
62 | |||
63 | /** |
||
64 | * {@inheritdoc} |
||
65 | * |
||
66 | * @throws LogicException |
||
67 | */ |
||
68 | 6 | public function getRelationship($name) |
|
80 | |||
81 | /** |
||
82 | * Get the method name for the given relationship. |
||
83 | * |
||
84 | * snake_case and kebab-case are converted into camelCase. |
||
85 | * |
||
86 | * @param string $name |
||
87 | * |
||
88 | * @return string |
||
89 | */ |
||
90 | 6 | private function getRelationshipMethodName($name) |
|
94 | } |
||
95 |
Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.