80 lines
2.0 KiB
PHP
80 lines
2.0 KiB
PHP
|
<?php
|
||
|
/**
|
||
|
* @package GetBible
|
||
|
*
|
||
|
* @created 30th May, 2023
|
||
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||
|
* @git GetBible <https://git.vdm.dev/getBible>
|
||
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||
|
*/
|
||
|
|
||
|
namespace VDM\Joomla\GetBible\Api;
|
||
|
|
||
|
|
||
|
use VDM\Joomla\GetBible\Abstraction\Api;
|
||
|
|
||
|
|
||
|
/**
|
||
|
* The GetBible Book Chapters
|
||
|
*
|
||
|
* @since 3.2.0
|
||
|
*/
|
||
|
final class Chapters extends Api
|
||
|
{
|
||
|
/**
|
||
|
* Get the chapters in a book in a translation
|
||
|
*
|
||
|
* @param int $book The book number.
|
||
|
* @param string $translation The translation.
|
||
|
*
|
||
|
* @return object|null The response object or null if an error occurs.
|
||
|
* @since 3.2.0
|
||
|
*/
|
||
|
public function get(int $book, string $translation = 'kjv'): ?object
|
||
|
{
|
||
|
return $this->response->get(
|
||
|
$this->http->get(
|
||
|
$this->uri->get($translation . '/' . $book . '.json')
|
||
|
)
|
||
|
);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* List the chapters of a book in a translation
|
||
|
*
|
||
|
* @param int $book The book number.
|
||
|
* @param string $translation The translation.
|
||
|
*
|
||
|
* @return object|null The response object or null if an error occurs.
|
||
|
* @since 3.2.0
|
||
|
*/
|
||
|
public function list(int $book, string $translation = 'kjv'): ?object
|
||
|
{
|
||
|
return $this->response->get(
|
||
|
$this->http->get(
|
||
|
$this->uri->get($translation . '/' . $book . '/chapters.json')
|
||
|
)
|
||
|
);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* List the chapters checksums of a book in a translation
|
||
|
*
|
||
|
* @param int $book The book number.
|
||
|
* @param string $translation The translation.
|
||
|
*
|
||
|
* @return object|null The response object or null if an error occurs.
|
||
|
* @since 3.2.0
|
||
|
*/
|
||
|
public function checksum(int $book, string $translation = 'kjv'): ?object
|
||
|
{
|
||
|
return $this->response->get(
|
||
|
$this->http->get(
|
||
|
$this->uri->get($translation . '/' . $book . '/checksum.json')
|
||
|
)
|
||
|
);
|
||
|
}
|
||
|
}
|
||
|
|