Documentation

Invoice extends DomainObject
in package

An Invoice

Tags
uses
DataType
uses
AHV

Table of Contents

Constants

EA  = 'EA'
GM  = 'GM'
KT  = 'KT'
KV  = 'KV'
DIRTY  = 1
GHOST  = 2
LOADED  = 4
LOADING  = 3
NEW  = 0

Properties

$data  : array<string|int, DataType>
$dataTypes  : array<string|int, mixed>
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()  : mixed
Sets a value instatiating a new DataType Object if none is set, or sets the value of the DataType
__toString()  : mixed
__unset()  : mixed
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
getValueObjectOf()  : Value
in()  : mixed
isDirty()  : bool
isGhost()  : bool
isNew()  : 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
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

$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, mixed> $dataTypes = [ // {{{ 'id' => \VeruA\DomainObjects\ValueObjects\IntKey::class, 'receiver' => \VeruA\DomainObjects\ValueObjects\DataType::class, 'id_klient' => \VeruA\DomainObjects\ValueObjects\Integer::class, 'id_owner' => \VeruA\DomainObjects\ValueObjects\Integer::class, // 'id_vers' => \VeruA\DomainObjects\ValueObjects\Integer::class, // KV 'amount' => \VeruA\DomainObjects\ValueObjects\Decimal::class, 'material' => \VeruA\DomainObjects\ValueObjects\Decimal::class, 'flextarif' => \VeruA\DomainObjects\ValueObjects\Decimal::class, // nur wenn auch KV/UV/MV/IV Leistungen auf der Rechnung sind (d.h. Rechnung an Vesicherung) {{{ 'vers_nr' => \VeruA\DomainObjects\ValueObjects\Varchar::class, // 'id_arzt' => \VeruA\DomainObjects\ValueObjects\Integer::class, 'reason' => \VeruA\DomainObjects\ValueObjects\Varchar::class, // grund der behandlung 'status' => \VeruA\DomainObjects\ValueObjects\Boolean::class, // ist behandlung abgeschlossen? 'id_kanton' => \VeruA\DomainObjects\ValueObjects\Integer::class, // for statistik/auswertung Wohnkanton of the client 'rkosten_anzeigen' => \VeruA\DomainObjects\ValueObjects\Boolean::class, // }}} 'client' => \VeruA\DomainObjects\Client::class, 'biller' => \VeruA\DomainObjects\Business::class, // Owner/Spitex 'insurance' => \VeruA\DomainObjects\Organisation::class, 'referrer' => \VeruA\DomainObjects\Doctor::class, // tabelle - verordnender Arzt // rechnungsempfänger, contains: if receiver = KV: insurance, KT: id_kt, GM: id_kt_2, EA: client 'debitor' => \VeruA\DomainObjects\Organisation::class, 'requestDate' => \VeruA\DomainObjects\ValueObjects\Date::class, // Rechnungsdatum 'from' => \VeruA\DomainObjects\ValueObjects\Date::class, // nur ganzer Monat bsp. 1.1.2021 'to' => \VeruA\DomainObjects\ValueObjects\Date::class, // nicht über mehrere Jahre bsp. 31.3.2021 'paid' => \VeruA\DomainObjects\ValueObjects\Date::class, 'schreiben' => \VeruA\DomainObjects\ValueObjects\Varchar::class, // 'props' => [], // evtl normalisieren 'gesetz' => \VeruA\DomainObjects\ValueObjects\Integer::class, // 'props' => ['unechterelation' => 'tarif|taxwert'], 'exported' => \VeruA\DomainObjects\ValueObjects\Boolean::class, // should be normalized 'exportedCag' => \VeruA\DomainObjects\ValueObjects\Boolean::class, // should be normalized 'exportedCeesv' => \VeruA\DomainObjects\ValueObjects\Boolean::class, // should be normalized 'exportedBillcare' => \VeruA\DomainObjects\ValueObjects\Boolean::class, // should be normalized 'exportedAbacus' => \VeruA\DomainObjects\ValueObjects\Boolean::class, // should be normalized // ea/kt/gm 'ea_befreit' => \VeruA\DomainObjects\ValueObjects\Boolean::class, 'id_rechempfänger' => \VeruA\DomainObjects\ValueObjects\Integer::class, // wrongly used in the xml as garantor -> as of 4.5 debitor 'id_kt' => \VeruA\DomainObjects\ValueObjects\Integer::class, // kt kostenträger // organisation 'id_kt_2' => \VeruA\DomainObjects\ValueObjects\Integer::class, // gm kostenträger // organisation 'sr' => \VeruA\DomainObjects\ValueObjects\Integer::class, // id der sammelrechnung 'id_zk' => \VeruA\DomainObjects\ValueObjects\Integer::class, // 'zeit_a' => \VeruA\DomainObjects\ValueObjects\Integer::class, 'zeit_b' => \VeruA\DomainObjects\ValueObjects\Integer::class, 'zeit_c' => \VeruA\DomainObjects\ValueObjects\Integer::class, // minuten 'nk_a' => \VeruA\DomainObjects\ValueObjects\Decimal::class, 'nk_b' => \VeruA\DomainObjects\ValueObjects\Decimal::class, 'nk_c' => \VeruA\DomainObjects\ValueObjects\Decimal::class, // decimal zusatzkosten 'kv_a' => \VeruA\DomainObjects\ValueObjects\Decimal::class, 'kv_b' => \VeruA\DomainObjects\ValueObjects\Decimal::class, 'kv_c' => \VeruA\DomainObjects\ValueObjects\Decimal::class, // private? 'berechnung' => \VeruA\DomainObjects\ValueObjects\Integer::class, // 2: stundensatz oder 1: taxpunkt rechnung 'gesamt_taxp' => \VeruA\DomainObjects\ValueObjects\DataType::class, 'tp_wert' => \VeruA\DomainObjects\ValueObjects\DataType::class, 'covid19' => \VeruA\DomainObjects\ValueObjects\Boolean::class, ]

gets assigned in the constructor by running 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 $name) : Value|mixed
Parameters
$name : 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 $name, mixed $value) : mixed
Parameters
$name : string

The name of the field

$value : mixed

The value

Tags
throws
OutOfRangeException

if the field does not exist

__unset()

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

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>

getValueObjectOf()

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

in()

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

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

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