\RoxModelBase

Acts as the base for all MVC-models and entities implements various database calls and makes sure the model and entities will always have a dao object (accessed using $this->dao)

Summary

Methods
Properties
Constants
__construct()
__call()
__get()
__set()
refresh_get()
__toString()
getLoggedInMember()
restoreLoggedInMember()
bulkLookup()
bulkLookup_assoc()
singleLookup()
singleLookup_assoc()
No public properties found
No constants found
get()
getValues()
getWords()
logWrite()
getLog()
getVersionInfo()
get_dao()
createEntity()
getDao()
getMemoryCookie()
setMemoryCookie()
$_entity_factory
N/A
No private methods found
$_parameters
$_cache
$logged_in_member
N/A

Properties

$_entity_factory

$_entity_factory : object

Holds an object of the entity factory, used for instantiating entities (obviously) Loaded by __construct() - so all descendants of RoxModelBase has access to it

Type

object — RoxEntityFactory

$_parameters

$_parameters

$_cache

$_cache

$logged_in_member

$logged_in_member : object

stores the currently logged in member

Type

object

Methods

__construct()

__construct()

used to instantiate an RoxEntityFactory - other than that, just calls the parent

__call()

__call( $key,  $args)

Parameters

$key
$args

__get()

__get( $key)

Parameters

$key

__set()

__set( $key,  $value)

Parameters

$key
$value

refresh_get()

refresh_get( $key)

Parameters

$key

__toString()

__toString()

getLoggedInMember()

getLoggedInMember() : object|false

returns the currently logged in member

Returns

object|false

restoreLoggedInMember()

restoreLoggedInMember()

Restore session if memory cookie exists

bulkLookup()

bulkLookup(string $query_string, array $keynames) : array

This method fetches a bunch of rows from the database.

It has some funny mechanics, which you can usually just ignore.

Parameters

string $query_string
array $keynames
  • this will trigger the funny mechanics which sort the results into a hierarchic structure

Returns

array —

of rows (as objects)

bulkLookup_assoc()

bulkLookup_assoc(\unknown_type $query_string) : array

This is the same as the above bulkLookup, but the rows are associative arrays instead of objects.

Parameters

\unknown_type $query_string

Returns

array —

of rows (as associative arrays)

singleLookup()

singleLookup( $query_string)

Parameters

$query_string

singleLookup_assoc()

singleLookup_assoc( $query_string)

Parameters

$query_string

get()

get( $key)

Parameters

$key

getValues()

getValues()

getWords()

getWords() : object

returns an instance of the MOD_words class

Returns

object

logWrite()

logWrite(string $string, string $type)

wrapper for calls to MOD_log::get->write()

Parameters

string $string
string $type

getLog()

getLog() : object

wrapper function for MOD_log::get()

Returns

object

getVersionInfo()

getVersionInfo() : string

returns the revision number saved in revision.txt

Returns

string

get_dao()

get_dao()

normally the $dao should be injected.

If it's not, this function creates a new one out of the blue..

createEntity()

createEntity() : object

calls the entity factory to create an entity, passes along any arguments

Returns

object

getDao()

getDao()

getMemoryCookie()

getMemoryCookie() : \array/boolean

Reads the contents of the memory cookie (for "stay logged in")

Returns

\array/boolean —

Contents of cookie or FALSE

setMemoryCookie()

setMemoryCookie( $id,  $seriesToken,  $authToken) : \array/boolean

Sets the contents of the memory cookie (for "stay logged in")

Parameters

$id
$seriesToken
$authToken

Returns

\array/boolean —

Contents of cookie or FALSE