Layer: Controller · Source: lib/controller/api/ArchivesApiController.php:29 (lines 29–265)
class ArchivesApiController extends ApiController
Archives API Controller
Handles API requests for post archives (by date)
| Tag | Value |
|---|---|
@category | Controller Class |
@author | Blogware Team |
@license | MIT |
@version | 1.0 |
@since | Since Release 1.0 |
| Relation | Type | Meaning |
|---|---|---|
| extends | ''ApiController'' | parent class/interface |
None.
| Visibility | Type | Name | Default | Line |
|---|---|---|---|---|
private | (untyped) | $hateoas | 34 | |
private | (untyped) | $postService | 39 |
| Visibility | Method | Summary | Line |
|---|---|---|---|
| public | __construct() | Constructor | 44 |
| public | index() | Get list of available archive dates (public endpoint) | 63 |
| public | year() | Get posts from a specific year (public endpoint) | 115 |
| public | month() | Get posts from a specific month (public endpoint) | 177 |
| private | getMonthName() | Get month name | 246 |
public function __construct()
lines 44–51 (8)
Constructor
Takes no parameters.
public function index($_params = [])
lines 63–105 (43)
Get list of available archive dates (public endpoint)
GET /api/v1/archives
Returns a list of years and months that have published posts
| Parameter | Type | Default | Description |
|---|---|---|---|
$_params | (untyped) | [] | none |
Returns: (none declared) — void
public function year($params = [])
lines 115–167 (53)
Get posts from a specific year (public endpoint)
GET /api/v1/archives/{year}
| Parameter | Type | Default | Description |
|---|---|---|---|
$params | (untyped) | [] | Route parameters including 'year' |
Returns: (none declared) — void
public function month($params = [])
lines 177–238 (62)
Get posts from a specific month (public endpoint)
GET /api/v1/archives/{year}/{month}
| Parameter | Type | Default | Description |
|---|---|---|---|
$params | (untyped) | [] | Route parameters including 'year' and 'month' |
Returns: (none declared) — void
private function getMonthName($month)
lines 246–264 (19)
Get month name
| Parameter | Type | Default | Description |
|---|---|---|---|
$month | (untyped) | required | none |
Returns: (none declared) — string
| Alias | Fully-qualified name |
|---|---|
ApiController | ''Scriptlog\Controller\ApiController'' |
ApiHateoas | ''Scriptlog\Core\ApiHateoas'' |
ApiResponse | ''Scriptlog\Core\ApiResponse'' |
FormValidator | ''Scriptlog\Core\FormValidator'' |
Sanitize | ''Scriptlog\Core\Sanitize'' |
PostDao | ''Scriptlog\Dao\PostDao'' |
PostApiDto | ''Scriptlog\Dto\Api\PostApiDto'' |
PostService | ''Scriptlog\Service\PostService'' |
This page is generated from source by 'tools/gendoc'. Edits will be overwritten.