Documentation

Owner extends DomainObject
in package
implements Business uses Log

A User from the Owner table

Table of Contents

Interfaces

Business
The Business interface asssures access to the Owner/Spitex data.

Constants

DIRTY  = 1
GHOST  = 2
LOADED  = 4
LOADING  = 3
NEW  = 0

Properties

$admin  : Boolean
$firstname  : Varchar
$gln  : EAN13
$id  : Integer
$lastname  : Varchar
$logo  : Image
$spitex  : Boolean
$username  : Varchar
$data  : array<string|int, DataType>
$dataTypes  : array<string|int, Value>
Contains all configured fields with their respective Values
$dirty  : array<string|int, bool>
$isDirty  : bool
$state  : int
$valid  : bool
$validated  : bool
$validator  : Validator
$violations  : Violations|null

Methods

__construct()  : void
Creates a new DomainObject
__get()  : Value|mixed
Returnes the {@link \VeruA\DomainObjects\DataType} of the requested field
__isset()  : mixed
__set()  : void
Sets a value instatiating a new DataType Object if none is set, or sets the value of the DataType
__toString()  : mixed
__unset()  : mixed
areModulesActive()  : bool
current()  : mixed
dataTypes()  : array<string|int, mixed>
Returns the DataType configuration
defaultValidators()  : array<string|int, mixed>
Overwrite this message if a DataType needs validation methods that are always applied
fullName()  : string
A commodity function to get the full Clients name composed as `nname, vname`
getValueObjectOf()  : Value
hasAccessToClient()  : bool
returns true if the owner has the permission to access the clients data
hasAccessToModule()  : bool
in()  : mixed
inCareOf()  : bool
returns true if the owner is in care of the client
isAdmin()  : bool
isDirty()  : bool
isGhost()  : bool
isModuleActive()  : bool
isNew()  : bool
isSpitex()  : bool
isValid()  : bool
Returns if this DMO is valid.
key()  : mixed
load()  : mixed
Puts all fields of $dmo into this DomainObject.
markDirty()  : mixed
markGhost()  : mixed
markLoaded()  : mixed
markNew()  : mixed
modules()  : mixed
Activate / Deactivate Modules
name()  : mixed
next()  : mixed
out()  : mixed
rewind()  : mixed
valid()  : mixed
validate()  : bool|ResultCollection
Validates the Object.
value()  : mixed
values()  : array<string|int, mixed>
Returns the internal data Array, containing all the DataType Objects
violations()  : ResultCollection
fields()  : array<string|int, mixed>
Configures the DomainObjects Fields

Constants

Properties

$admin

public Boolean $admin

@deprecated Has user admin rights? use isAdmin()

$username

public Varchar $username

The username to login (benutzer)

$data

protected array<string|int, DataType> $data = []

Contains the ValueObjects with their respective values

$dataTypes

Contains all configured fields with their respective Values

protected array<string|int, Value> $dataTypes = []

gets assigned in the constructor by running the fields() method

Tags
todo

should we replace this entierly by the fields method

$dirty

protected array<string|int, bool> $dirty = []

array that contains every field as key that changed after construction with value true

$violations

protected Violations|null $violations = null

Methods

__construct()

Creates a new DomainObject

public __construct([Key|array<string|int, mixed> $data = null ]) : void

The DomainObject can be created in the following ways:

  • If an Object of Type ValueObjects\Key is passed, the DomainObjects state is GHOST and will be loaded according to the DataSource, when a field is accessed
  • Without a parameter an empty DomainObject is created in the NEW state
  • If $data is an array, it has to be in the form 'field => 'value' as configured in the fields method
Parameters
$data : Key|array<string|int, mixed> = null

Sets the values of the DomainObject. Every value is passed to the respective or if a Key is passed a new empty GHOST is created

Tags
see
IntKey

__get()

Returnes the {@link \VeruA\DomainObjects\DataType} of the requested field

public __get(string $field) : Value|mixed
Parameters
$field : string
Return values
Value|mixed

Returns the DataType of the field

__isset()

public __isset(mixed $field) : mixed
Parameters
$field : mixed

__set()

Sets a value instatiating a new DataType Object if none is set, or sets the value of the DataType

public __set(string $field, mixed $value) : void
Parameters
$field : string
$value : mixed

The value

__unset()

public __unset(mixed $name) : mixed
Parameters
$name : mixed

areModulesActive()

public areModulesActive(array<string|int, mixed> $modules) : bool
Parameters
$modules : array<string|int, mixed>
Return values
bool

dataTypes()

Returns the DataType configuration

public dataTypes() : array<string|int, mixed>
Return values
array<string|int, mixed>

defaultValidators()

Overwrite this message if a DataType needs validation methods that are always applied

public static defaultValidators() : array<string|int, mixed>
Return values
array<string|int, mixed>

fullName()

A commodity function to get the full Clients name composed as `nname, vname`

public fullName() : string
Tags
todo

add a parameter to customize the formatting/composition

Return values
string

The full name

getValueObjectOf()

public getValueObjectOf(string $field) : Value
Parameters
$field : string
Return values
Value

hasAccessToClient()

returns true if the owner has the permission to access the clients data

public hasAccessToClient(mixed $clientId) : bool
Parameters
$clientId : mixed
Return values
bool

hasAccessToModule()

public hasAccessToModule(string $module) : bool
Parameters
$module : string
Return values
bool

in()

public in(mixed $dmo) : mixed
Parameters
$dmo : mixed

inCareOf()

returns true if the owner is in care of the client

public inCareOf(mixed $clientId) : bool
Parameters
$clientId : mixed
Return values
bool

isAdmin()

public isAdmin() : bool
Return values
bool

isModuleActive()

public isModuleActive(string $module) : bool
Parameters
$module : string
Return values
bool

isSpitex()

public isSpitex() : bool
Return values
bool

isValid()

Returns if this DMO is valid.

public isValid([Validator|null $validator = null ]) : bool

If the DMO is not in a validated state, or because it was not already validated, or because changes has been made, it is validated. If a validator is given as argument, the DMO is always validated and the internal state is not altered

Parameters
$validator : Validator|null = null
Return values
bool

modules()

Activate / Deactivate Modules

public modules(array<string|int, mixed> $modules) : mixed
Parameters
$modules : array<string|int, mixed>
Tags
todo

put moduels in a separate table. Do not use the fields directly to change state, to ease migration

name()

public name() : mixed

values()

Returns the internal data Array, containing all the DataType Objects

public values() : array<string|int, mixed>
Return values
array<string|int, mixed>

fields()

Configures the DomainObjects Fields

protected fields(array<string|int, mixed> ...$superFields) : array<string|int, mixed>

Overwrite this method to assign the filds with their respective ValueObjects make sure to call the parent an pass along all of the $superFields arrays like so ...$superFields The concept is simple. Every SuperClass adds its fields in a separate array, and passes them to the parent, DomainObject::fields merges them together to have all of the inherited fields available

Parameters
$superFields : array<string|int, mixed>
Return values
array<string|int, mixed>

        
On this page

Search results