| 1 | <?php |
||
| 16 | abstract class AbstractSerializer implements SerializerInterface |
||
| 17 | { |
||
| 18 | /** |
||
| 19 | * The type. |
||
| 20 | * |
||
| 21 | * @var string |
||
| 22 | */ |
||
| 23 | protected $type; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * {@inheritdoc} |
||
| 27 | */ |
||
| 28 | 30 | public function getType($model) |
|
| 32 | |||
| 33 | /** |
||
| 34 | * {@inheritdoc} |
||
| 35 | */ |
||
| 36 | 30 | public function getId($model) |
|
| 40 | |||
| 41 | /** |
||
| 42 | * {@inheritdoc} |
||
| 43 | */ |
||
| 44 | public function getAttributes($model, array $fields = null) |
||
| 48 | |||
| 49 | /** |
||
| 50 | * {@inheritdoc} |
||
| 51 | */ |
||
| 52 | 12 | public function getLinks($model) |
|
| 56 | |||
| 57 | /** |
||
| 58 | * {@inheritdoc} |
||
| 59 | */ |
||
| 60 | 12 | public function getMeta($model) |
|
| 64 | |||
| 65 | /** |
||
| 66 | * {@inheritdoc} |
||
| 67 | * |
||
| 68 | * @throws LogicException |
||
| 69 | */ |
||
| 70 | 9 | public function getRelationship($model, $name) |
|
| 84 | |||
| 85 | /** |
||
| 86 | * Get the serializer method name for the given relationship. |
||
| 87 | * |
||
| 88 | * kebab-case is converted into camelCase. |
||
| 89 | * |
||
| 90 | * @param string $name |
||
| 91 | * @return string |
||
| 92 | */ |
||
| 93 | 9 | private function getRelationshipMethodName($name) |
|
| 101 | } |
||
| 102 |
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.