Documentation

SiteInfo
in package
Uses Singleton

Utility class that returns generally useful information about parts of the site

Table of Contents

$context  : Context
$fwtables  : array<, string>
$instance  : object
The only instance of using class
$fields  : array<, mixed>
collect()  : Generator
Get beans in chunks and turn them one by one using a generator
contexts()  : array<, OODBBean>
Get all the Rolecontext beans
count()  : int
Return the count for a particular bean
fetch()  : array<, OODBBean>
Get bean data
form()  : OODBBean|null
Get a specific form
forms()  : array<, OODBBean>
Get all the form beans
getinstance()  : object
Checks, instantiates and returns the only instance of the using class.
hasField()  : bool
Check to see if a table has a given field
isFWTable()  : bool
Check if table is a framework table
pageCount()  : int
Do a page count calculation for a table
pages()  : array<, OODBBean>
Get all the page beans
roles()  : array<, OODBBean>
Get all the Rolename beans
siteConfig()  : array<, OODBBean>
Get all the site config information
tablecount()  : int
Number of tables
tableExists()  : bool
Check to see if a table exists - utility function used by AJAX
tables()  : array<, mixed>
Return bean table data
users()  : array<, OODBBean>
Get all the user beans
usersWith()  : array<, OODBBean>
Get all users with a particular context/role
__construct()  : mixed
Class constructor. The concrete class using this trait can override it.

Properties

$fwtables

protected static array<, string> $fwtables = [ConfigFramework::CONFIG, ConfigFramework::CONFIRM, ConfigFramework::FORM, ConfigFramework::FORMFIELD, ConfigFramework::PAGE, ConfigFramework::PAGEROLE, ConfigFramework::ROLE, ConfigFramework::ROLECONTEXT, ConfigFramework::ROLENAME, ConfigFramework::USER]

A list of the Framework DB tables

$instance

The only instance of using class

protected static object $instance = NULL

$fields

private static array<, mixed> $fields = []

Field information for tables

Methods

collect()

Get beans in chunks and turn them one by one using a generator

public collect(string $bean, string $where[, array<, mixed> $params = [] ][, int $start = -1 ], int $count) : Generator
Parameters
$bean : string

A bean name

$where : string

An SQL where condition

$params : array<, mixed> = []

Substitutions for the where clause

$start : int = -1

The start position

$count : int

The number wanted.

Tags
psalm-return

\Generator<mixed, mixed, mixed, void> But this yields beans

Return values
Generator

contexts()

Get all the Rolecontext beans

public contexts([int $start = -1 ][, int $count = -1 ][, string $order = '' ][, bool $collect = FALSE ]) : array<, OODBBean>
Parameters
$start : int = -1

Start position - used for pagination

$count : int = -1

The number to be fetched - used for pagination

$order : string = ''

An order clause

$collect : bool = FALSE

If TRUE then use collect not fetch

Return values
array<, OODBBean>

count()

Return the count for a particular bean

public count(string $bean[, string $where = '' ][, array<, mixed> $params = [] ]) : int
Parameters
$bean : string

The bean kind

$where : string = ''

The where condition

$params : array<, mixed> = []

Parameter values for query (if any)

Return values
int

fetch()

Get bean data

public fetch(string $bean, string $where[, array<, mixed> $params = [] ][, int $start = -1 ], int $count) : array<, OODBBean>
Parameters
$bean : string

The bean kind

$where : string

The where condition

$params : array<, mixed> = []

Parameter values for query (if any)

$start : int = -1

Start position - used for pagination

$count : int

The number to be fetched - used for pagination

Return values
array<, OODBBean>

form()

Get a specific form

public form(string $name) : OODBBean|null
Parameters
$name : string

The name of the form

Return values
OODBBean|null

forms()

Get all the form beans

public forms([int $start = -1 ][, int $count = -1 ][, string $order = '' ][, bool $collect = FALSE ]) : array<, OODBBean>
Parameters
$start : int = -1

Start position - used for pagination

$count : int = -1

The number to be fetched - used for pagination

$order : string = ''

An order clause

$collect : bool = FALSE

If TRUE then use collect not fetch

Return values
array<, OODBBean>

getinstance()

Checks, instantiates and returns the only instance of the using class.

public static getinstance() : object
Tags
template

object

psalm-return

object

psalm-suppress

MismatchingDocblockReturnType

psalm-suppress

ReservedWord

Return values
object

hasField()

Check to see if a table has a given field

public static hasField(string $table, string $field) : bool
Parameters
$table : string
$field : string
Return values
bool

isFWTable()

Check if table is a framework table

public static isFWTable(string $table) : bool
Parameters
$table : string
Tags
psalm-suppress

PossiblyUnusedMethod

Return values
bool

pageCount()

Do a page count calculation for a table

public pageCount(string $table, int $pagesize[, string $where = '' ][, array<, mixed> $pars = [] ]) : int
Parameters
$table : string
$pagesize : int
$where : string = ''
$pars : array<, mixed> = []
Tags
psalm-suppress

PossiblyUnusedMethod

Return values
int

pages()

Get all the page beans

public pages([int $start = -1 ][, int $count = -1 ][, string $order = '' ][, bool $collect = FALSE ]) : array<, OODBBean>
Parameters
$start : int = -1

Start position - used for pagination

$count : int = -1

The number to be fetched - used for pagination

$order : string = ''

An order clause

$collect : bool = FALSE

If TRUE then use collect not fetch

Return values
array<, OODBBean>

roles()

Get all the Rolename beans

public roles([int $start = -1 ][, int $count = -1 ][, string $order = '' ][, bool $collect = FALSE ]) : array<, OODBBean>
Parameters
$start : int = -1

Start position - used for pagination

$count : int = -1

The number to be fetched - used for pagination

$order : string = ''

An order clause

$collect : bool = FALSE

If TRUE then use collect not fetch

Return values
array<, OODBBean>

siteConfig()

Get all the site config information

public siteConfig([int $start = -1 ][, int $count = -1 ][, string $order = '' ][, bool $collect = FALSE ]) : array<, OODBBean>
Parameters
$start : int = -1

Start position - used for pagination

$count : int = -1

The number to be fetched - used for pagination

$order : string = ''

An order clause

$collect : bool = FALSE

If TRUE then use collect not fetch

Return values
array<, OODBBean>

tablecount()

Number of tables

public static tablecount([bool $all = FALSE ]) : int
Parameters
$all : bool = FALSE
Tags
psalm-suppress

PossiblyUnusedMethod

Return values
int

tableExists()

Check to see if a table exists - utility function used by AJAX

public static tableExists(string $table) : bool
Parameters
$table : string
Return values
bool

tables()

Return bean table data

public tables([bool $all = FALSE ][, int $start = -1 ][, int $count = -1 ]) : array<, mixed>
Parameters
$all : bool = FALSE

If TRUE then return all beans, otherwise just non-framework beans.

$start : int = -1
$count : int = -1
Tags
psalm-suppress

PossiblyUnusedMethod

Return values
array<, mixed>

users()

Get all the user beans

public users([int $start = -1 ][, int $count = -1 ][, string $order = '' ][, bool $collect = FALSE ]) : array<, OODBBean>
Parameters
$start : int = -1

Start position - used for pagination

$count : int = -1

The number to be fetched - used for pagination

$order : string = ''

An order clause

$collect : bool = FALSE

If TRUE then use collect not fetch

Return values
array<, OODBBean>

usersWith()

Get all users with a particular context/role

public usersWith( $rolecontext,  $rolename[, bool $all = FALSE ][, int $start = -1 ][, int $count = -1 ][, string $order = '' ][, bool $collect = FALSE ]) : array<, OODBBean>
Parameters
$rolecontext :
$rolename :
$all : bool = FALSE

If TRUE do not check if role is currentyl active

$start : int = -1

Start position - used for pagination

$count : int = -1

The number to be fetched - used for pagination

$order : string = ''

An order clause

$collect : bool = FALSE

If TRUE then use collect not fetch

Tags
phpcsSuppress

SlevomatCodingStandard.Functions.UnusedParameter

Return values
array<, OODBBean>

__construct()

Class constructor. The concrete class using this trait can override it.

protected __construct() : mixed
Tags
psalm-suppress

PropertyTypeCoercion

Return values
mixed

Search results