$root
$root : string
The root storage folder starting at %DATA%/folder/
$project : \FAA\Obj\Generic\Project
In project context A reference to another overlaying project
$prices : array<mixed,\FAA\Obj\Sys\RowPrice>
Buffer prices Storage for row prices as resolved object list.
$template : null|\FAA\Obj\Generic\Template
A local instance of the assigned template
MainProject() : \FAA\Obj\Generic\Project|null
Resolve the main project of this service/bill
GetLastKnownEvent( $type) : \FAA\Obj\Sys\Event|null
Get newest event of type
Iterate of elements list and return the newest entry
$type |
PriceList() : array<mixed,\FAA\Obj\Sys\RowPrice>
Price list Resolve the prices list to row price objects. This method is cached.
A list of row price objects
ToPlainReducedObject(array $fields, string $language = null) : Object
Convert to reduced plain data set Translate and expose the current data attribute as plain resolved object with filtered attributes
array | $fields | List of attributes to show |
string | $language | A system language code or empty for raw setup |
A simple attribute based php object
GetCompanyObject() : \FAA\Obj\Generic\Company
Get company
Get the main company from content
A company object or null when list is empty
GitRepo() : \FAA\Git|null
Get the related git instance
Will open a git instance on demand, this method is cached locally
FormattedId(string $prefix, string $pad_string = '0', integer $pad_length = 5, integer $pad_type = STR_PAD_LEFT) : string
expose the formatted object id provide an interface to extract the current id with formatting options
string | $prefix | A prefix |
string | $pad_string | The pad character |
integer | $pad_length | The padding length |
integer | $pad_type | The padding type |
The formatted id
GetState() : \FAA\Obj\Result
Expose the state Provide an interface to extract the current status
the object status
GetPlainOriginalAttribute(string $key, string $language = '') : mixed
Get original value get a plain resolved attribute value from the local storage
string | $key | The searched attribute key |
string | $language | The searched language key or false for all |
The found value
Contains(array $filter, string $language = null) : boolean
Check if attribute contains the search string
Matches the filters against the given attribute selected
array | $filter | List of filters with operation, target attribute and value attr string The attribute to check op string The search operator e.g. LIKE value string The search string * matches all |
string | $language | The loader value to get the attributes in |
When matching true
GetPlainOfRevision(string $hash, boolean $tolerate_error = false) : \FAA\Obj\Result
Fetch a certain version of a file based on the given hash
string | $hash | The git revision hash |
boolean | $tolerate_error | Ignore index errors on demand |
A system result object
GetListOfRevisions() : \FAA\Obj\Result
List versions
Load and provide a list of stored revisions for this objects. Will use git to determinate this list.
A system result object
Delete(boolean $skip = false) : \FAA\Obj\Result
Do delete Delete entity from file system and git repository This method can delete this content object from our local storage system
boolean | $skip | Skip hooks on demand |
A default system result set
Convert(string $target) : \FAA\Obj\Result
Convert to other object type
string | $target | The target name |
The conversion result
Copy(mixed $target = null) : \FAA\Obj\Result
clone object entry in file system and git repository store the current payload inside the system storage and commit the changes to the local repository
mixed | $target | For compatibility reasons with several subtypes this argument is required |
A default system result set
Save(boolean $force_new_id = false) : \FAA\Obj\Result
Save service in file system and git repository
Will call the parent method to save the changes first. Then it checks if all bills have a version and if not, they will get the version of the previously commited service
boolean | $force_new_id | Indicate force new id on demand (local id empty) |
A default system result set
ToPlainObject(string $language = null, boolean $with_parent = true) : \stdClass
convert to plain data set translate and expose the current data attribute as plain resolved object
string | $language | A system language code or empty for raw setup |
boolean | $with_parent | When set to true the attributes will be resolved witch parent attributes included |
A simple attribute based php object
GetCustomerObject() : \FAA\Obj\Generic\Customer
Get customer
Get the sub customer from content
A customer object or null when list is empty
CreateMissingBills(\FAA\Obj\Generic\Project $project, boolean $force = false) : \FAA\Obj\Result
Create the missing bill entries
Build the pdfs of all bills that are not available locally
\FAA\Obj\Generic\Project | $project | The parent project |
boolean | $force | Force re rendering of bill |
The render result
GetBillPdfs(\FAA\Obj\Generic\Project $project, null $date_from = null, null $date_to = null) : \FAA\Obj\Result
Get all bill pdf files for a certain time frame in a project context
\FAA\Obj\Generic\Project | $project | The parent project |
null | $date_from | Filter date from |
null | $date_to | Filter date to |
The fetch result
SetAllBillsPayed() : \FAA\Obj\Result
Set all bills tpo payed
GetTemplate(string $name = 'template') : \FAA\Obj\Generic\Template
Load template
Helper method to load the assigned template and return as object. This one is cached locally.
string | $name | Type of template to fetch |
A system template object covered in a result object
ServiceToOffer(string $language = null, \FAA\Obj\Generic\Project $project = null) : \FAA\Obj\Result
Get the offer pdf
Generates the offer pdf file based on the defined template nd the given language
string | $language | The target language |
\FAA\Obj\Generic\Project | $project | The parent project |
The result
SendOfferToCustomer(string $language = null) : \FAA\Obj\Result
Send offer mail
Send the offer email to the defined emailaddress of the assigned customer
string | $language | A language key |
A system result object
SendBillToCustomer(string $language = null) : \FAA\Obj\Result
Send the bill to the customer
Creates the mail object based on the configuration and send it to the customer
string | $language | The template language |
The send result
RegisterBillNumber(\FAA\Obj\Generic\Project $project) : \FAA\Obj\Result
Register a new billing number to the service on demand
Checks if the service has bills and adds new ones when not and not recurring. When it has not and recurring property flag is set, it will either reuse the locked number of the bill item or, create a new bill item with new number. The date will be set either to the date from or the next bill date.
This method does saves the service on demand and therefor commits at least one file to the database.
\FAA\Obj\Generic\Project | $project | The parent project object |
A system result object
CreateBill(\FAA\Obj\Generic\Project $project, string $version = null, string $number = null) : \FAA\Obj\Result
Create a bill
Create a pdf bill and return the download path. When a version is given this will cause an sym link operation to a newly loaded version of this service.
\FAA\Obj\Generic\Project | $project | A project object |
string | $version | A certain version to generate the bill for |
string | $number | A certain number in the bill list (requires resolve of version) |
A default system result object
BillPreview(\FAA\Obj\Generic\Project $project, string $number = null) : \FAA\Obj\Result
Get preview for certain bill or in general
\FAA\Obj\Generic\Project | $project | The parent project |
string | $number | The bill number or null |
loadFromSrc()
Load data from source
Fetch the content master file for this entry by given path The data will be stored in the local data property, when the data is encrypted it will be locally decrypted This function has not return value but a side effect on status. It will handle the cases when an entity is encryped in a transparent way
setPlainSubAttribute(array $target, mixed $value, string $path)
set a sub attribute update or add a plain attribute to this object this method will resolve the . separated path until the end of the limb is reached and $this->data was updated
array | $target | A reference tho the this->data branch the update is target of |
mixed | $value | The new value |
string | $path | The remaining path components to target |