Scriptlog Docs

Scriptlog Documentation

Code reference for the Scriptlog codebase

User Tools

Site Tools


scriptlog:lib:controller:archivesapicontroller

This is an old revision of the document!


ArchivesApiController

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)

Docblock Metadata

^ Tag ^ Value ^
| ''@category'' | Controller Class |
| ''@author'' | Blogware Team |
| ''@license'' | MIT |
| ''@version'' | 1.0 |
| ''@since'' | Since Release 1.0 |

Inheritance

^ Relation ^ Type ^ Meaning ^
| extends | [[scriptlog:lib:controller:apicontroller|''ApiController'']] | parent class/interface |

Constants (0)

None.

Properties (0)

None declared.

Methods (5)

^ 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 |

__construct()

public function __construct()

lines 44–51 (8)

Constructor

Takes no parameters.

index()

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

year()

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

month()

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

getMonthName()

private function getMonthName($month)

lines 246–264 (19)

Get month name

^ Parameter ^ Type ^ Default ^ Description ^
| ''$month'' | ''(untyped)'' | //required// | //none// |

Returns: (none declared) — string

Imports

^ Alias ^ Fully-qualified name ^
| ''ApiController'' | [[scriptlog:lib:controller:apicontroller|''Scriptlog\Controller\ApiController'']] |
| ''ApiHateoas'' | [[scriptlog:lib:core:apihateoas|''Scriptlog\Core\ApiHateoas'']] |
| ''ApiResponse'' | [[scriptlog:lib:core:apiresponse|''Scriptlog\Core\ApiResponse'']] |
| ''FormValidator'' | [[scriptlog:lib:core:formvalidator|''Scriptlog\Core\FormValidator'']] |
| ''Sanitize'' | [[scriptlog:lib:core:sanitize|''Scriptlog\Core\Sanitize'']] |
| ''PostDao'' | [[scriptlog:lib:dao:postdao|''Scriptlog\Dao\PostDao'']] |
| ''PostApiDto'' | [[scriptlog:lib:dto:postapidto|''Scriptlog\Dto\Api\PostApiDto'']] |
| ''PostService'' | [[scriptlog:lib:service:postservice|''Scriptlog\Service\PostService'']] |

This page is generated from source by 'tools/gendoc'. Edits will be overwritten.

scriptlog/lib/controller/archivesapicontroller.1790413760.txt.gz · Last modified: by admin