|
@@ 22-35 (lines=14) @@
|
| 19 |
|
$this->defaultParameters = $defaultParameters; |
| 20 |
|
} |
| 21 |
|
|
| 22 |
|
public function getEndpoints(Model $model = null): array |
| 23 |
|
{ |
| 24 |
|
$endpointType = new ActionEndpointType([$this->controller], $this->defaultParameters); |
| 25 |
|
|
| 26 |
|
$controller = new $this->controller(); |
| 27 |
|
|
| 28 |
|
$endPointName = property_exists($controller, 'endPointMethod') |
| 29 |
|
? $controller->endPointMethod |
| 30 |
|
: 'invoke'; |
| 31 |
|
|
| 32 |
|
$endpointType->setName($endPointName); |
| 33 |
|
|
| 34 |
|
return $endpointType->getEndpoints($model); |
| 35 |
|
} |
| 36 |
|
|
| 37 |
|
public function getCollectionEndpoints(): array |
| 38 |
|
{ |
|
@@ 37-50 (lines=14) @@
|
| 34 |
|
return $endpointType->getEndpoints($model); |
| 35 |
|
} |
| 36 |
|
|
| 37 |
|
public function getCollectionEndpoints(): array |
| 38 |
|
{ |
| 39 |
|
$endpointType = new ActionEndpointType([$this->controller], $this->defaultParameters); |
| 40 |
|
|
| 41 |
|
$controller = new $this->controller(); |
| 42 |
|
|
| 43 |
|
$endPointName = property_exists($controller, 'collectionEndPointMethod') |
| 44 |
|
? $controller->collectionEndPointMethod |
| 45 |
|
: 'invoke'; |
| 46 |
|
|
| 47 |
|
$endpointType->setName($endPointName); |
| 48 |
|
|
| 49 |
|
return $endpointType->getEndpoints(); |
| 50 |
|
} |
| 51 |
|
} |
| 52 |
|
|