\FAA\Obj\GenericProject

Summary

Methods
Properties
Constants
__construct()
UpdateAttributeName()
UpdateAttributeActive()
GetEmailSetup()
Services()
FormattedBillNumber()
CreateBill()
HasNotRecurring()
HasRecurring()
NextBillDate()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
startDate()
getService()
$root
$contents
N/A

Properties

$root

$root :

Type

$contents

$contents :

Type

Methods

__construct()

__construct(string  $path,string  $language = null)

Instance project Construct a new project object

Parameters

string $path

The relative object storage path

string $language

The setup language

UpdateAttributeName()

UpdateAttributeName(\stdClass  $attr,string  $data): \FAA\Obj\Result

Callback on update validate name This function is called when the primary identifier is changed

Parameters

\stdClass $attr

The changed attribute

string $data

The new attribute value

Returns

\FAA\Obj\Result —

A system result object

UpdateAttributeActive()

UpdateAttributeActive(Object  $attr,boolean  $data): \FAA\Obj\Result

Callback on update validate active state This function is called when the create bill status is changed

Parameters

Object $attr

The changed attribute

boolean $data

The new attribute value

Returns

\FAA\Obj\Result —

A system result object

GetEmailSetup()

GetEmailSetup(): \FAA\Obj\Generic\EmailSetup

Get notification email Get the main notification from content

Returns

\FAA\Obj\Generic\EmailSetup —

A email setup object or null when list is empty

Services()

Services(array  $filter = array()): array<mixed,\FAA\Obj\Generic\Service>

List of services A list of services that are assigned to this project and the sub projects

ToDo: Migrate this method to use the search functions instead of file based loader aka "Contents" method

Parameters

array $filter

When set to true list the recurring prices bool $recurring When set to true list the recurring prices bool $only_active Count only active services

Returns

array<mixed,\FAA\Obj\Generic\Service> —

A list of service objects

FormattedBillNumber()

FormattedBillNumber(): string

Get bill number Get the formatted bill number with pad left and prefix

Returns

string —

The formatted bill number

CreateBill()

CreateBill(boolean  $recurring = false,\FAA\Obj\Generic\CronJobServiceBill  $cron = null): \FAA\Obj\Result

Create a bill Create a pdf bill and return the download path

Parameters

boolean $recurring

When set to true list the recurring prices

\FAA\Obj\Generic\CronJobServiceBill $cron

A cron job object or null

Returns

\FAA\Obj\Result —

A default system result object

HasNotRecurring()

HasNotRecurring(boolean  $only_active = false): integer

Has no recurring Check if this project has not recurring services

Parameters

boolean $only_active

Count only active services

Returns

integer —

The length of registered assigned recurring contents

HasRecurring()

HasRecurring(boolean  $only_active = false): integer

Has recurring Check if this project has recurring services

Parameters

boolean $only_active

Count only active services

Returns

integer —

The length of registered assigned recurring contents

NextBillDate()

NextBillDate(boolean  $raw = false): integer|string

Get next bill date Fetch the next bill date

Parameters

boolean $raw

When set to true, return as timestamp

Returns

integer|string —

The next formatted billing date

startDate()

startDate()

getService()

getService(integer  $id,string  $sub_type): \FAA\Obj\Generic\Service

Get service object Get a single service

Parameters

integer $id

A service id

string $sub_type

A service sub type name

Returns

\FAA\Obj\Generic\Service —

A service object or null