Skip to content

ScripturNum ScripturNum

James K. edited this page Sep 5, 2023 · 4 revisions

ScripturNum\ScripturNum

  • Class name: ScripturNum
  • Namespace: \ScripturNum

Properties

int

protected mixed int
  • Visibility: protected

book

protected mixed book
  • Visibility: protected

startCh

protected mixed startCh
  • Visibility: protected

startV

protected mixed startV
  • Visibility: protected

endCh

protected mixed endCh
  • Visibility: protected

endV

protected mixed endV
  • Visibility: protected

stringSettings

protected mixed stringSettings = ['abbrev' => ['space' => '', 'cvsep' => '.', 'range' => '-', 'names' => 1, 'plurl' => false], 'long' => ['space' => ' ', 'cvsep' => ':', 'range' => '-', 'names' => 0, 'plurl' => true]]
  • Visibility: protected

Methods

__construct

mixed ScripturNum\ScripturNum::__construct(int|string intOrString)

ScripturNum constructor.

  • Visibility: public

Arguments

  • intOrString int|string - ScripturNum int or a human-readable string.

Returns

  • mixed

setStringSettings

mixed ScripturNum\ScripturNum::setStringSettings(mixed key, array settings)
  • Visibility: public
  • This method is static.

Arguments

  • key mixed* settings array

Returns

  • mixed

getInt

int ScripturNum\ScripturNum::getInt()

Get the ScripturNum integer.

  • Visibility: public

Returns

  • int -

__toString

mixed ScripturNum\ScripturNum::__toString()
  • Visibility: public

Returns

  • mixed

getAbbrev

string ScripturNum\ScripturNum::getAbbrev()

Get a human-readable abbreviation for the passage. By default, these are meant for usage in short links.

  • Visibility: public

Returns

  • string - An abbreviation

getLongString

string ScripturNum\ScripturNum::getLongString()

Get a human-readable name of the passage. By default, these are meant for humans to read.

  • Visibility: public

Returns

  • string - The name of the passage, as one might pronounce it.

getStringWithSettings

string ScripturNum\ScripturNum::getStringWithSettings(string settingKey)

Returns a human-readable string with the settings defined in a given setting set.

  • Visibility: public

Arguments

  • settingKey string - The setting set to use. Default options are 'abbrev' and 'long'

Returns

  • string - The human-intelligible string.

isWholeChapters

mixed ScripturNum\ScripturNum::isWholeChapters()
  • Visibility: public

Returns

  • mixed

isWholeBook

mixed ScripturNum\ScripturNum::isWholeBook()
  • Visibility: public

Returns

  • mixed

bookHasSingleChapter

mixed ScripturNum\ScripturNum::bookHasSingleChapter()
  • Visibility: public

Returns

  • mixed

_bookName2bookNum

mixed ScripturNum\ScripturNum::_bookName2bookNum(mixed bookName)
  • Visibility: protected
  • This method is static.

Arguments

  • bookName mixed

Returns

  • mixed

newFromParsed

mixed ScripturNum\ScripturNum::newFromParsed(mixed bookStr, mixed startCh, mixed startV, mixed endCh, mixed endV)
  • Visibility: public
  • This method is static.

Arguments

  • bookStr mixed* startCh mixed* startV mixed* endCh mixed* endV mixed

Returns

  • mixed

newFromInts

\ScripturNum\ScripturNum ScripturNum\ScripturNum::newFromInts(int book, int startCh, int startV, int|null endCh, int|null endV)
  • Visibility: public
  • This method is static.

Arguments

  • book int - The book of the Bible the range is within. 1-rel.
  • startCh int - The chapter of the start of the range. 1-rel.
  • startV int - The verse of the start of the range. 1-rel. Defaults to 1.
  • endCh int|null - The end chapter of the range. If null or not provided, assumed to be the same as the start chapter.
  • endV int|null - The end verse of the range. If null or not provided, assumed to be the end of the chapter.

Returns

  • \ScripturNum\ScripturNum - The ScripturNum object that represents this range of scripture.

string2int

int ScripturNum\ScripturNum::string2int(string string)
  • Visibility: public
  • This method is static.

Arguments

  • string string - A human-readable scripture reference that should be converted to an int.

Returns

  • int - The int.

_refNums2int

mixed ScripturNum\ScripturNum::_refNums2int(mixed book, mixed startCh, mixed startV, mixed endCh, mixed endV)
  • Visibility: protected
  • This method is static.

Arguments

  • book mixed* startCh mixed* startV mixed* endCh mixed* endV mixed

Returns

  • mixed

_refNumString2refNums

mixed ScripturNum\ScripturNum::_refNumString2refNums(string string, chapterStart, verseStart, chapterEnd, verseEnd)

This function reads through a ref string one character at a time to parse it into a known reference.

  • Visibility: protected
  • This method is static.

Arguments

  • string string - The string to parse.
  • chapterStart mixed* verseStart mixed* chapterEnd mixed* verseEnd mixed

Returns

  • mixed

_int2refNums

mixed ScripturNum\ScripturNum::_int2refNums(int int, int book, int chapterStart, int verseStart, int chapterEnd, int verseEnd)

Converts a ScripturNum int into reference numbers.

  • Visibility: protected
  • This method is static.

Arguments

  • int int - The ScripturNum integer
  • book int - The book number
  • chapterStart int - The first Chapter
  • verseStart int - The first Verse
  • chapterEnd int - The last Chapter
  • verseEnd int - The last Verse

Returns

  • mixed

int2concats

mixed ScripturNum\ScripturNum::int2concats(int int, string|int concatStart, string|int concatEnd)

Convert a ScrupturNum int into a concatenated number. (Concatenated numbers are often used for text libraries.)

  • Visibility: public
  • This method is static.

Arguments

  • int int - The int representing the full passage
  • concatStart string|int - The concatenated "number" possibly larger than an int representing the start of the passage.
  • concatEnd string|int - The concatenated "number" possibly larger than an int representing the end of the passage.

Returns

  • mixed

_bkIndex2singleRef

mixed ScripturNum\ScripturNum::_bkIndex2singleRef(int book, int index, int chapter, int verse)

Parse a book index number into a chapter and verse.

  • Visibility: protected
  • This method is static.

Arguments

  • book int - Book number
  • index int - Verse Index Number
  • chapter int - Chapter
  • verse int - Verse

Returns

  • mixed

Clone this wiki locally