| @@ 11-51 (lines=41) @@ | ||
| 8 | * Class MeasurementEndpoint |
|
| 9 | * @package Choccybiccy\HumanApi\Endpoint |
|
| 10 | */ |
|
| 11 | abstract class MeasurementEndpoint extends Endpoint |
|
| 12 | { |
|
| 13 | ||
| 14 | /** |
|
| 15 | * @var string |
|
| 16 | */ |
|
| 17 | protected $plural = "readings"; |
|
| 18 | ||
| 19 | /** |
|
| 20 | * {@inheritDoc} |
|
| 21 | */ |
|
| 22 | protected function buildSpecificEntryUrl($id) |
|
| 23 | { |
|
| 24 | return $this->buildUrlParts(array( |
|
| 25 | $this->type, |
|
| 26 | $this->plural, |
|
| 27 | $id |
|
| 28 | )); |
|
| 29 | } |
|
| 30 | ||
| 31 | /** |
|
| 32 | * {@inheritDoc} |
|
| 33 | */ |
|
| 34 | protected function buildListUrl() |
|
| 35 | { |
|
| 36 | return $this->buildUrlParts(array( |
|
| 37 | $this->type, |
|
| 38 | $this->plural, |
|
| 39 | )); |
|
| 40 | } |
|
| 41 | ||
| 42 | /** |
|
| 43 | * {@inheritDoc} |
|
| 44 | */ |
|
| 45 | protected function buildRecentUrl() |
|
| 46 | { |
|
| 47 | return $this->buildUrlParts(array( |
|
| 48 | $this->type, |
|
| 49 | )); |
|
| 50 | } |
|
| 51 | } |
|
| 52 | ||
| @@ 11-50 (lines=40) @@ | ||
| 8 | * Class PeriodicEndpoint |
|
| 9 | * @package Choccybiccy\HumanApi\Endpoint |
|
| 10 | */ |
|
| 11 | abstract class PeriodicEndpoint extends Endpoint |
|
| 12 | { |
|
| 13 | ||
| 14 | /** |
|
| 15 | * @var string |
|
| 16 | */ |
|
| 17 | protected $plural = "summaries"; |
|
| 18 | ||
| 19 | /** |
|
| 20 | * {@inheritDoc} |
|
| 21 | */ |
|
| 22 | protected function buildSpecificEntryUrl($id) |
|
| 23 | { |
|
| 24 | return $this->buildUrlParts(array( |
|
| 25 | $this->type, |
|
| 26 | $id |
|
| 27 | )); |
|
| 28 | } |
|
| 29 | ||
| 30 | /** |
|
| 31 | * {@inheritDoc} |
|
| 32 | */ |
|
| 33 | protected function buildListUrl() |
|
| 34 | { |
|
| 35 | return $this->buildUrlParts(array( |
|
| 36 | $this->type, |
|
| 37 | )); |
|
| 38 | } |
|
| 39 | ||
| 40 | /** |
|
| 41 | * {@inheritDoc} |
|
| 42 | */ |
|
| 43 | protected function buildRecentUrl() |
|
| 44 | { |
|
| 45 | return $this->buildUrlParts(array( |
|
| 46 | $this->type, |
|
| 47 | $this->plural, |
|
| 48 | )); |
|
| 49 | } |
|
| 50 | } |
|
| 51 | ||