150 lines
3.6 KiB
Markdown
150 lines
3.6 KiB
Markdown
```
|
|
██████╗ ██████╗ ██╗ ██╗███████╗██████╗
|
|
██╔══██╗██╔═══██╗██║ ██║██╔════╝██╔══██╗
|
|
██████╔╝██║ ██║██║ █╗ ██║█████╗ ██████╔╝
|
|
██╔═══╝ ██║ ██║██║███╗██║██╔══╝ ██╔══██╗
|
|
██║ ╚██████╔╝╚███╔███╔╝███████╗██║ ██║
|
|
╚═╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝
|
|
```
|
|
# final class Watcher (Details)
|
|
> namespace: **TrueChristianChurch\Joomla\GetBible**
|
|
```uml
|
|
@startuml
|
|
class Watcher << (F,LightGreen) >> #RoyalBlue {
|
|
# Load $load
|
|
# Translation $translation
|
|
# Book $book
|
|
# Chapter $chapter
|
|
# bool $fresh
|
|
+ __construct(Load $load, Translation $translation, ...)
|
|
+ sync(string $translation, int $book, ...) : bool
|
|
+ isNew() : bool
|
|
+ enoughVerses(string $translation = 'kjv') : bool
|
|
+ totalVerses(string $translation = 'kjv') : ?int
|
|
+ getNextChapter(string $translation, int $book, ...) : ?int
|
|
+ getPreviousChapter(int $chapter, bool $force = false) : ?int
|
|
+ getLastChapter(string $translation, int $book) : ?int
|
|
+ getNextBook(string $translation, int $book, ...) : ?int
|
|
+ getPreviousBook(string $translation, int $book, ...) : ?int
|
|
- forceUpdate(bool $state) : void
|
|
}
|
|
|
|
note right of Watcher::__construct
|
|
Constructor
|
|
|
|
since: 2.0.1
|
|
|
|
arguments:
|
|
Load $load
|
|
Translation $translation
|
|
Book $book
|
|
Chapter $chapter
|
|
end note
|
|
|
|
note left of Watcher::sync
|
|
Watching that the local Database and API is in sync
|
|
|
|
since: 2.0.1
|
|
return: bool
|
|
|
|
arguments:
|
|
string $translation
|
|
int $book
|
|
int $chapter
|
|
bool $force = false
|
|
end note
|
|
|
|
note right of Watcher::isNew
|
|
The see if new chapters was installed, and therefore new
|
|
|
|
since: 2.0.1
|
|
return: bool
|
|
end note
|
|
|
|
note left of Watcher::enoughVerses
|
|
Check if a translation has enough verses
|
|
|
|
since: 2.0.1
|
|
return: bool
|
|
end note
|
|
|
|
note right of Watcher::totalVerses
|
|
Get the total number of verses in the database of a given translation
|
|
|
|
since: 2.0.1
|
|
return: ?int
|
|
end note
|
|
|
|
note left of Watcher::getNextChapter
|
|
Get the next chapter
|
|
|
|
since: 2.0.1
|
|
return: ?int
|
|
|
|
arguments:
|
|
string $translation
|
|
int $book
|
|
int $chapter
|
|
bool $force = false
|
|
end note
|
|
|
|
note right of Watcher::getPreviousChapter
|
|
Get the previous chapter
|
|
|
|
since: 2.0.1
|
|
return: ?int
|
|
end note
|
|
|
|
note left of Watcher::getLastChapter
|
|
Get the last chapter of a book
|
|
|
|
since: 2.0.1
|
|
return: ?int
|
|
end note
|
|
|
|
note right of Watcher::getNextBook
|
|
Get the next book
|
|
|
|
since: 2.0.1
|
|
return: ?int
|
|
|
|
arguments:
|
|
string $translation
|
|
int $book
|
|
int $try
|
|
end note
|
|
|
|
note left of Watcher::getPreviousBook
|
|
Get the previous book
|
|
|
|
since: 2.0.1
|
|
return: ?int
|
|
|
|
arguments:
|
|
string $translation
|
|
int $book
|
|
int $try
|
|
end note
|
|
|
|
note right of Watcher::forceUpdate
|
|
The method to set the update state
|
|
|
|
since: 2.0.1
|
|
return: void
|
|
end note
|
|
|
|
@enduml
|
|
```
|
|
|
|
---
|
|
```
|
|
██╗ ██████╗██████╗
|
|
██║██╔════╝██╔══██╗
|
|
██║██║ ██████╔╝
|
|
██ ██║██║ ██╔══██╗
|
|
╚█████╔╝╚██████╗██████╔╝
|
|
╚════╝ ╚═════╝╚═════╝
|
|
```
|
|
> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)
|
|
|