From 29955216d69ca08b69afe1ace71151839049c045 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Sat, 7 Feb 2015 21:06:17 +0100 Subject: Added documentation --- docs/classes/BusinessAdmin.html | 854 ++++++++++++++++++++++ docs/classes/assignment.html | 1195 ++++++++++++++++++++++++++++++ docs/classes/client.html | 731 +++++++++++++++++++ docs/classes/constants.html | 785 ++++++++++++++++++++ docs/classes/contact.html | 1365 ++++++++++++++++++++++++++++++++++ docs/classes/correspondence.html | 682 +++++++++++++++++ docs/classes/file.html | 611 ++++++++++++++++ docs/classes/offer.html | 1491 ++++++++++++++++++++++++++++++++++++++ docs/classes/response.html | 618 ++++++++++++++++ 9 files changed, 8332 insertions(+) create mode 100644 docs/classes/BusinessAdmin.html create mode 100644 docs/classes/assignment.html create mode 100644 docs/classes/client.html create mode 100644 docs/classes/constants.html create mode 100644 docs/classes/contact.html create mode 100644 docs/classes/correspondence.html create mode 100644 docs/classes/file.html create mode 100644 docs/classes/offer.html create mode 100644 docs/classes/response.html (limited to 'docs/classes') diff --git a/docs/classes/BusinessAdmin.html b/docs/classes/BusinessAdmin.html new file mode 100644 index 0000000..c5da975 --- /dev/null +++ b/docs/classes/BusinessAdmin.html @@ -0,0 +1,854 @@ + + + + + + API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

\BusinessAdmin

+

Provides basic functions like adding elements to the database

+ + + +
+

Summary

+
+
+ Methods +
+
+ Properties +
+
+ Constants +
+
+
+
+ getClientIds()
+ getClients()
+ getContactIds()
+ getContacts()
+ getOfferIds()
+ getOffers()
+ getAssignmentIds()
+ getAssignments()
+ createClient()
+ createFile()
+ formatDate()
+
+
+ No public properties found +
+
+ No constants found +
+
+
+
+ No protected methods found +
+
+ No protected properties found +
+
+ N/A +
+
+
+
+ No private methods found +
+
+ No private properties found +
+
+ N/A +
+
+
+
+ +
+ + + + +
+

Methods

+ +
+ +
+
+ +
+

getClientIds()

+ +
getClientIds(\PDO  $pdo) : array<mixed,integer>
+

Get all client ids

+ + +

Parameters

+ + + + + + +
\PDO$pdo

The PDO class for database connection

+ +

Throws

+
+
\PDOException
+

Is something went wrong with the database

+
+ +

Returns

+ array<mixed,integer> + —

The ids

+ +
+
+ +
+ +
+
+ +
+

getClients()

+ +
getClients(\PDO  $pdo) : array<mixed,\client>
+

Get all clients

+ + +

Parameters

+ + + + + + +
\PDO$pdo

The PDO class for database connection

+ +

Throws

+
+
\PDOException
+

If something went wrong with the database

+
+ +

Returns

+ array<mixed,\client> + —

An array indexed by id of instances of the client class

+ +
+
+ +
+ +
+
+ +
+

getContactIds()

+ +
getContactIds(\PDO  $pdo) : array<mixed,integer>
+

Get all contact ids

+ + +

Parameters

+ + + + + + +
\PDO$pdo

The PDO class for database connection

+ +

Throws

+
+
\PDOException
+

Is something went wrong with the database

+
+ +

Returns

+ array<mixed,integer> + —

The ids

+ +
+
+ +
+ +
+
+ +
+

getContacts()

+ +
getContacts(\PDO  $pdo) : array<mixed,\contact>
+

Get all contacts

+ + +

Parameters

+ + + + + + +
\PDO$pdo

The PDO class for database connection

+ +

Throws

+
+
\PDOException
+

If something went wrong with the database

+
+ +

Returns

+ array<mixed,\contact> + —

An array indexed by id of instances of the contact class

+ +
+
+ +
+ +
+
+ +
+

getOfferIds()

+ +
getOfferIds(\PDO  $pdo, array<mixed,string>  $where = array()) : array<mixed,integer>
+

Get all offer ids

+ + +

Parameters

+ + + + + + + + + + + +
\PDO$pdo

The PDO class for database connection

array<mixed,string>$where

An array of WHERE clauses that will be AND-ed

+ +

Throws

+
+
\PDOException
+

Is something went wrong with the database

+
+ +

Returns

+ array<mixed,integer> + —

The ids

+ +
+
+ +
+ +
+
+ +
+

getOffers()

+ +
getOffers(\PDO  $pdo, array<mixed,string>  $where = array()) : array<mixed,\offer>
+

Get all offers

+ + +

Parameters

+ + + + + + + + + + + +
\PDO$pdo

The PDO class for database connection

array<mixed,string>$where

An array of WHERE clauses that will be AND-ed

+ +

Throws

+
+
\PDOException
+

If something went wrong with the database

+
+ +

Returns

+ array<mixed,\offer> + —

An array indexed by id of instances of the offer class

+ +
+
+ +
+ +
+
+ +
+

getAssignmentIds()

+ +
getAssignmentIds(\PDO  $pdo) : array<mixed,integer>
+

Get all assignment ids

+ + +

Parameters

+ + + + + + +
\PDO$pdo

The PDO class for database connection

+ +

Throws

+
+
\PDOException
+

Is something went wrong with the database

+
+ +

Returns

+ array<mixed,integer> + —

The ids

+ +
+
+ +
+ +
+
+ +
+

getAssignments()

+ +
getAssignments(\PDO  $pdo) : array<mixed,\assignment>
+

Get all assignments

+ + +

Parameters

+ + + + + + +
\PDO$pdo

The PDO class for database connection

+ +

Throws

+
+
\PDOException
+

If something went wrong with the database

+
+ +

Returns

+ array<mixed,\assignment> + —

An array indexed by id of instances of the assignment class

+ +
+
+ +
+ +
+
+ +
+

createClient()

+ +
createClient(\PDO  $pdo, string  $name) : \client|boolean
+

Create a new client

+ + +

Parameters

+ + + + + + + + + + + +
\PDO$pdo

The database connection

string$name

The name for the new client

+ +

Throws

+
+
\PDOException
+

If something went wrong with the database

+
+ +

Returns

+ \client|boolean + —

A new instance of the client object, or false on failure

+ +
+
+ +
+ +
+
+ +
+

createFile()

+ +
createFile(\PDO  $pdo, string  $filename) : \file
+

Create a new file

+ + +

Parameters

+ + + + + + + + + + + +
\PDO$pdo

The database connection

string$filename

The desired filename

+ +

Throws

+
+
\PDOException
+

If something went wrong with the database

+
\Exception
+

If the file could not be created (due to permissions, file existed already, etc.), or the database record couldn't be added

+
+ +

Returns

+ \file + —

A new instance of the file object

+ +
+
+ +
+ +
+
+ +
+

formatDate()

+ +
formatDate(integer  $timestamp, boolean  $with_time = true, boolean  $full_date = false, boolean  $relatively = false) : string
+

Format a date nicely

+ + +

Parameters

+ + + + + + + + + + + + + + + + + + + + + +
integer$timestamp

The UNIX timestamp to format

boolean$with_time

If false, only the date is returned; if false, also the time

boolean$full_date

If true, a year will be outputted even if the date is in the current year

boolean$relatively

Whether or not to show the date relatively (e.g. '1 day ago') (NOT IMPLEMENTED YET)

+ + +

Returns

+ string + —

The formatted date

+ +
+
+ +
+ +
+
+ + + + +
+ + + diff --git a/docs/classes/assignment.html b/docs/classes/assignment.html new file mode 100644 index 0000000..c5e0fbd --- /dev/null +++ b/docs/classes/assignment.html @@ -0,0 +1,1195 @@ + + + + + + API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

\assignment

+

An interface to the assignment table in the database

+ + + +
+

Summary

+
+
+ Methods +
+
+ Properties +
+
+ Constants +
+
+
+
+ __construct()
+ getId()
+ getOfferId()
+ getOffer()
+ getTitle()
+ setTitle()
+ getDescription()
+ setDescription()
+ getHours()
+ setHours()
+ getPricePerHour()
+ setPricePerHour()
+ getVAT()
+ setVAT()
+ calculate()
+ delete()
+
+
+ No public properties found +
+
+ SUBTOTAL
+ VAT
+ TOTAL
+
+
+
+
+ No protected methods found +
+
+ $pdo
+ $offerId
+ $id
+ $title
+ $description
+ $hours
+ $price_per_hour
+ $vat
+
+
+ N/A +
+
+
+
+ No private methods found +
+
+ No private properties found +
+
+ N/A +
+
+
+
+ +
+ + +
+
+

Constants

+
+ +
+ +
+
+ +
+

SUBTOTAL

+
SUBTOTAL
+

+ +
+
+ +
+ +
+
+ +
+

VAT

+
VAT
+

+ +
+
+ +
+ +
+
+ +
+

TOTAL

+
TOTAL
+

+ +
+
+ +
+ + + +
+
+

Properties

+
+ +
+ +
+
+ +
+

$pdo

+
$pdo : \pdo
+

+ + +

Type

+ \pdo + — The PDO class for database communication
+
+ +
+ +
+
+ +
+

$offerId

+
$offerId : \pdo
+

+ + +

Type

+ \pdo + — The PDO class for database communication
+
+ +
+ +
+
+ +
+

$id

+
$id : \pdo
+

+ + +

Type

+ \pdo + — The PDO class for database communication
+
+ +
+ +
+
+ +
+

$title

+
$title : \pdo
+

+ + +

Type

+ \pdo + — The PDO class for database communication
+
+ +
+ +
+
+ +
+

$description

+
$description : \pdo
+

+ + +

Type

+ \pdo + — The PDO class for database communication
+
+ +
+ +
+
+ +
+

$hours

+
$hours : \pdo
+

+ + +

Type

+ \pdo + — The PDO class for database communication
+
+ +
+ +
+
+ +
+

$price_per_hour

+
$price_per_hour : \pdo
+

+ + +

Type

+ \pdo + — The PDO class for database communication
+
+ +
+ +
+
+ +
+

$vat

+
$vat : \pdo
+

+ + +

Type

+ \pdo + — The PDO class for database communication
+
+ +
+ + + +
+

Methods

+ +
+ +
+
+ +
+

__construct()

+ +
__construct(\PDO  $pdo, integer  $id) 
+

Create a new instance

+ + +

Parameters

+ + + + + + + + + + + +
\PDO$pdo

The PDO class, to access the database

integer$id

The id of the assignment to fetch

+ +

Throws

+
+
\PDOException
+

If something went wrong with the database

+
\Exception
+

If the assignment could not be found

+
+ + +
+
+ +
+ +
+
+ +
+

getId()

+ +
getId() : integer
+

Get the ID of the assignment

+ + + + +

Returns

+ integer + —

The ID

+ +
+
+ +
+ +
+
+ +
+

getOfferId()

+ +
getOfferId() : integer
+

Get the ID of the offer that this assignment is linked to

+ + + + +

Returns

+ integer + —

The ID

+ +
+
+ +
+ +
+
+ +
+

getOffer()

+ +
getOffer() : \offer
+

Get the offer that this assignment is linked to

+ + + + +

Returns

+ \offer + —

The offer

+ +
+
+ +
+ +
+
+ +
+

getTitle()

+ +
getTitle() : string
+

Get the title of the assignment

+ + + + +

Returns

+ string + —

The title

+ +
+
+ +
+ +
+
+ +
+

setTitle()

+ +
setTitle(string  $title) : boolean
+

Set the title of the assignment

+ + +

Parameters

+ + + + + + +
string$title

The new title for the assignment

+ +

Throws

+
+
\PDOException
+

If something went wrong with the database

+
+ +

Returns

+ boolean + —

True on succes, false on failure

+ +
+
+ +
+ +
+
+ +
+

getDescription()

+ +
getDescription(boolean  $parseMarkdown = true) : string
+

Get the description of the assignment

+ + +

Parameters

+ + + + + + +
boolean$parseMarkdown

Whether or not to parse markdown

+ + +

Returns

+ string + —

The description

+ +
+
+ +
+ +
+
+ +
+

setDescription()

+ +
setDescription(string  $description) : boolean
+

Set the description of the assignment

+ + +

Parameters

+ + + + + + +
string$description

The new description for the assignment

+ +

Throws

+
+
\PDOException
+

If something went wrong with the database

+
+ +

Returns

+ boolean + —

True on succes, false on failure

+ +
+
+ +
+ +
+
+ +
+

getHours()

+ +
getHours() : integer
+

Get the amount of hours of the assignment

+ + + + +

Returns

+ integer + —

The amount of hours

+ +
+
+ +
+ +
+
+ +
+

setHours()

+ +
setHours(integer  $hours) : boolean
+

Set the amount of hours of the assignment

+ + +

Parameters

+ + + + + + +
integer$hours

The new amount hours for the assignment

+ +

Throws

+
+
\PDOException
+

If something went wrong with the database

+
+ +

Returns

+ boolean + —

True on succes, false on failure

+ +
+
+ +
+ +
+
+ +
+

getPricePerHour()

+ +
getPricePerHour() : float
+

Get the price per hour of the assignment

+ + + + +

Returns

+ float + —

The price per hour

+ +
+
+ +
+ +
+
+ +
+

setPricePerHour()

+ +
setPricePerHour(float  $price_per_hour) : boolean
+

Set the price per hour of the assignment

+ + +

Parameters

+ + + + + + +
float$price_per_hour

The new price per hour for the assignment

+ +

Throws

+
+
\PDOException
+

If something went wrong with the database

+
+ +

Returns

+ boolean + —

True on succes, false on failure

+ +
+
+ +
+ +
+
+ +
+

getVAT()

+ +
getVAT() : float
+

Get the VAT percentage of the assignment

+ + + + +

Returns

+ float + —

The VAT percentage

+ +
+
+ +
+ +
+
+ +
+

setVAT()

+ +
setVAT(float  $vat) : boolean
+

Set the VAT percentage of the assignment

+ + +

Parameters

+ + + + + + +
float$vat

The new VAT percentage for the assignment

+ +

Throws

+
+
\PDOException
+

If something went wrong with the database

+
+ +

Returns

+ boolean + —

True on succes, false on failure

+ +
+
+ +
+ +
+
+ +
+

calculate()

+ +
calculate(integer  $what = self::TOTAL, integer  $round = 2, boolean  $format = true) : float|boolean
+

Calculate useful numbers about the assignment

+

Subtotal: price_per_hour * hours

+

VAT: subtotal * VAT_percentage

+

Total: subtotal + VAT

+ +

Parameters

+ + + + + + + + + + + + + + + + +
integer$what

Any of assignment::SUBTOTAL, assignment::VAT, assignment::TOTAL

integer$round

How many decimals to round on

boolean$format

Whether to format the number nicely (for output) or not (for calculations)

+ +

Throws

+
+
\PDOException
+

If something went wrong with the database

+
+ +

Returns

+ float|boolean + —

The calculated value rounded on $round decimals, or false when the input is incorrect

+ +
+
+ +
+ +
+
+ +
+

delete()

+ +
delete() : boolean
+

Remove this assignment from the database

+

If this doesn't succeed (i.e. false is returned), that means the assignment was removed manually or by another instance of this class

+ + +

Throws

+
+
\PDOException
+

If something went wrong with the database

+
+ +

Returns

+ boolean + —

True on success, false on failure

+ +
+
+ +
+ +
+
+ + + + +
+ + + diff --git a/docs/classes/client.html b/docs/classes/client.html new file mode 100644 index 0000000..4a3b2db --- /dev/null +++ b/docs/classes/client.html @@ -0,0 +1,731 @@ + + + + + + API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

\client

+

An interface to the client table in the database

+ + + +
+

Summary

+
+
+ Methods +
+
+ Properties +
+
+ Constants +
+
+
+
+ __construct()
+ getId()
+ getName()
+ setName()
+ getContactIds()
+ getContacts()
+ delete()
+ createContact()
+
+
+ No public properties found +
+
+ No constants found +
+
+
+
+ No protected methods found +
+
+ $pdo
+ $id
+ $name
+
+
+ N/A +
+
+
+
+ No private methods found +
+
+ No private properties found +
+
+ N/A +
+
+
+
+ +
+ + + +
+
+

Properties

+
+ +
+ +
+
+ +
+

$pdo

+
$pdo : \pdo
+

+ + +

Type

+ \pdo + — The PDO class for database communication
+
+ +
+ +
+
+ +
+

$id

+
$id : \pdo
+

+ + +

Type

+ \pdo + — The PDO class for database communication
+
+ +
+ +
+
+ +
+

$name

+
$name : \pdo
+

+ + +

Type

+ \pdo + — The PDO class for database communication
+
+ +
+ + + +
+

Methods

+ +
+ +
+
+ +
+

__construct()

+ +
__construct(\PDO  $pdo, integer  $id) 
+

Create a new instance

+ + +

Parameters

+ + + + + + + + + + + +
\PDO$pdo

The PDO class, to access the database

integer$id

The id of the client to fetch

+ +

Throws

+
+
\PDOException
+

If something went wrong with the database

+
\Exception
+

If the client could not be found

+
+ + +
+
+ +
+ +
+
+ +
+

getId()

+ +
getId() : integer
+

Get the ID of the client

+ + + + +

Returns

+ integer + —

The ID

+ +
+
+ +
+ +
+
+ +
+

getName()

+ +
getName() : string
+

Get the name of the client

+ + + + +

Returns

+ string + —

The name

+ +
+
+ +
+ +
+
+ +
+

setName()

+ +
setName(string  $name) : boolean
+

Set the name of the client

+ + +

Parameters

+ + + + + + +
string$name

The new name for the client

+ +

Throws

+
+
\PDOException
+

If something went wrong with the database

+
+ +

Returns

+ boolean + —

True on succes, false on failure

+ +
+
+ +
+ +
+
+ +
+

getContactIds()

+ +
getContactIds() : array<mixed,integer>
+

Get all contact ids for this client

+ + + +

Throws

+
+
\PDOException
+

Is something went wrong with the database

+
+ +

Returns

+ array<mixed,integer> + —

The ids

+ +
+
+ +
+ +
+
+ +
+

getContacts()

+ +
getContacts() : array<mixed,\contact>
+

Get all contacts for this client

+ + + +

Throws

+
+
\PDOException
+

If something went wrong with the database

+
+ +

Returns

+ array<mixed,\contact> + —

An array indexed by id of instances of the contact class

+ +
+
+ +
+ +
+
+ +
+

delete()

+ +
delete() : boolean
+

Remove this client from the database

+

If this doesn't succeed (i.e. false is returned), that means the client was removed manually or by another instance of this class

+ + +

Throws

+
+
\PDOException
+

If something went wrong with the database

+
+ +

Returns

+ boolean + —

True on success, false on failure

+ +
+
+ +
+ +
+
+ +
+

createContact()

+ +
createContact(string  $name, string  $email, string  $address, string  $address_2, string  $postal_code, string  $city, string  $country) : \contact
+

Make a new contact for this client

+ + +

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
string$name

The name for this contact

string$email

The email for this contact

string$address

The first address line of this contact (normally street and house number)

string$address_2

The second address line of this contact

string$postal_code

The postal code for this contact

string$city

The city for this contact

string$country

The country for this contact

+ +

Throws

+
+
\PDOException
+

If something went wrong with the database

+
\Exception
+

If there was a problem with the input

+
+ +

Returns

+ \contact + —

A new instance of the contact class containing the new contact

+ +
+
+ +
+ +
+
+ + + + +
+ + + diff --git a/docs/classes/constants.html b/docs/classes/constants.html new file mode 100644 index 0000000..bac6d42 --- /dev/null +++ b/docs/classes/constants.html @@ -0,0 +1,785 @@ + + + + + + API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

\constants

+

A class for some constants

+ + + +
+

Summary

+
+
+ Methods +
+
+ Properties +
+
+ Constants +
+
+
+
+ No public methods found +
+
+ No public properties found +
+
+ db_prefix
+ files_folder
+ files_folder_external
+ files_folder_trash
+ url_external
+ url_internal
+ my_name
+ invoice_name
+ invoice_address_1
+ invoice_address_2
+ invoice_address_3
+ invoice_tax_nr
+ invoice_iban
+ invoice_bic
+ invoice_tel_nr
+ invoice_email
+ invoice_valuta
+ version
+
+
+
+
+ No protected methods found +
+
+ No protected properties found +
+
+ N/A +
+
+
+
+ No private methods found +
+
+ No private properties found +
+
+ N/A +
+
+
+
+ +
+ + +
+
+

Constants

+
+ +
+ +
+
+ +
+

db_prefix

+
db_prefix
+

+ +
+
+ +
+ +
+
+ +
+

files_folder

+
files_folder
+

+ +
+
+ +
+ +
+
+ +
+

files_folder_external

+
files_folder_external
+

+ +
+
+ +
+ +
+
+ +
+

files_folder_trash

+
files_folder_trash
+

+ +
+
+ +
+ +
+
+ +
+

url_external

+
url_external
+

+ +
+
+ +
+ +
+
+ +
+

url_internal

+
url_internal
+

+ +
+
+ +
+ +
+
+ +
+

my_name

+
my_name
+

+ +
+
+ +
+ +
+
+ +
+

invoice_name

+
invoice_name
+

+ +
+
+ +
+ +
+
+ +
+

invoice_address_1

+
invoice_address_1
+

+ +
+
+ +
+ +
+
+ +
+

invoice_address_2

+
invoice_address_2
+

+ +
+
+ +
+ +
+
+ +
+

invoice_address_3

+
invoice_address_3
+

+ +
+
+ +
+ +
+
+ +
+

invoice_tax_nr

+
invoice_tax_nr
+

+ +
+
+ +
+ +
+
+ +
+

invoice_iban

+
invoice_iban
+

+ +
+
+ +
+ +
+
+ +
+

invoice_bic

+
invoice_bic
+

+ +
+
+ +
+ +
+
+ +
+

invoice_tel_nr

+
invoice_tel_nr
+

+ +
+
+ +
+ +
+
+ +
+

invoice_email

+
invoice_email
+

+ +
+
+ +
+ +
+
+ +
+

invoice_valuta

+
invoice_valuta
+

+ +
+
+ +
+ +
+
+ +
+

version

+
version
+

+ +
+
+ +
+ + + +
+
+ + + + +
+ + + diff --git a/docs/classes/contact.html b/docs/classes/contact.html new file mode 100644 index 0000000..09ba426 --- /dev/null +++ b/docs/classes/contact.html @@ -0,0 +1,1365 @@ + + + + + + API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

\contact

+

An interface to the contact table in the database

+ + + +
+

Summary

+
+
+ Methods +
+
+ Properties +
+
+ Constants +
+
+
+
+ __construct()
+ getId()
+ getClientId()
+ getClient()
+ getName()
+ setName()
+ getEmail()
+ setEmail()
+ getAddress()
+ setAddress()
+ getAddress_2()
+ setAddress_2()
+ getPostalCode()
+ setPostalCode()
+ getCity()
+ setCity()
+ getCountry()
+ setCountry()
+ getLanguage()
+ setLanguage()
+ delete()
+ createOffer()
+
+
+ No public properties found +
+
+ No constants found +
+
+
+
+ No protected methods found +
+
+ $pdo
+ $id
+ $clientId
+ $name
+ $email
+ $address
+ $postal_code
+ $city
+ $country
+ $language
+
+
+ N/A +
+
+
+
+ No private methods found +
+
+ No private properties found +
+
+ N/A +
+
+
+
+ +
+ + + +
+
+

Properties

+
+ +
+ +
+
+ +
+

$pdo

+
$pdo : \PDO
+

+ + +

Type

+ \PDO + — The PDO class for database communication
+
+ +
+ +
+
+ +
+

$id

+
$id : \PDO
+

+ + +

Type

+ \PDO + — The PDO class for database communication
+
+ +
+ +
+
+ +
+

$clientId

+
$clientId : \PDO
+

+ + +

Type

+ \PDO + — The PDO class for database communication
+
+ +
+ +
+
+ +
+

$name

+
$name : \PDO
+

+ + +

Type

+ \PDO + — The PDO class for database communication
+
+ +
+ +
+
+ +
+

$email

+
$email : \PDO
+

+ + +

Type

+ \PDO + — The PDO class for database communication
+
+ +
+ +
+
+ +
+

$address

+
$address : \PDO
+

+ + +

Type

+ \PDO + — The PDO class for database communication
+
+ +
+ +
+
+ +
+

$postal_code

+
$postal_code : \PDO
+

+ + +

Type

+ \PDO + — The PDO class for database communication
+
+ +
+ +
+
+ +
+

$city

+
$city : \PDO
+

+ + +

Type

+ \PDO + — The PDO class for database communication
+
+ +
+ +
+
+ +
+

$country

+
$country : \PDO
+

+ + +

Type

+ \PDO + — The PDO class for database communication
+
+ +
+ +
+
+ +
+

$language

+
$language : \PDO
+

+ + +

Type

+ \PDO + — The PDO class for database communication
+
+ +
+ + + +
+

Methods

+ +
+ +
+
+ +
+

__construct()

+ +
__construct(\PDO  $pdo, integer  $id) 
+

Create a new instance

+ + +

Parameters

+ + + + + + + + + + + +
\PDO$pdo

The PDO class, to access the database

integer$id

The id of the contact to fetch

+ +

Throws

+
+
\PDOException
+

If something went wrong with the database

+
\Exception
+

If the contact could not be found

+
+ + +
+
+ +
+ +
+
+ +
+

getId()

+ +
getId() : integer
+

Get the ID of the contact

+ + + + +

Returns

+ integer + —

The ID

+ +
+
+ +
+ +
+
+ +
+

getClientId()

+ +
getClientId() : integer
+

Get the ID of the client that this contact is linked to

+ + + + +

Returns

+ integer + —

The ID

+ +
+
+ +
+ +
+
+ +
+

getClient()

+ +
getClient() : \client
+

Get the client that this contact is linked to

+ + + + +

Returns

+ \client + —

The client

+ +
+
+ +
+ +
+
+ +
+

getName()

+ +
getName() : string
+

Get the name of the contact

+ + + + +

Returns

+ string + —

The name

+ +
+
+ +
+ +
+
+ +
+

setName()

+ +
setName(string  $name) : boolean
+

Set the name of the contact

+ + +

Parameters

+ + + + + + +
string$name

The new name for the contact

+ +

Throws

+
+
\PDOException
+

If something went wrong with the database

+
+ +

Returns

+ boolean + —

True on succes, false on failure

+ +
+
+ +
+ +
+
+ +
+

getEmail()

+ +
getEmail() : string
+

Get the email of the contact

+ + + + +

Returns

+ string + —

The email

+ +
+
+ +
+ +
+
+ +
+

setEmail()

+ +
setEmail(string  $email) : boolean
+

Set the email of the contact

+ + +

Parameters

+ + + + + + +
string$email

The new email for the contact

+ +

Throws

+
+
\PDOException
+

If something went wrong with the database

+
+ +

Returns

+ boolean + —

True on succes, false on failure

+ +
+
+ +
+ +
+
+ +
+

getAddress()

+ +
getAddress() : string
+

Get the first address line of the contact

+ + + + +

Returns

+ string + —

The address

+ +
+
+ +
+ +
+
+ +
+

setAddress()

+ +
setAddress(string  $address) : boolean
+

Set the first address line of the contact

+ + +

Parameters

+ + + + + + +
string$address

The new address for the contact

+ +

Throws

+
+
\PDOException
+

If something went wrong with the database

+
+ +

Returns

+ boolean + —

True on succes, false on failure

+ +
+
+ +
+ +
+
+ +
+

getAddress_2()

+ +
getAddress_2() : string
+

Get the second address line of the contact

+ + + + +

Returns

+ string + —

The address

+ +
+
+ +
+ +
+
+ +
+

setAddress_2()

+ +
setAddress_2(string  $address_2) : boolean
+

Set the second address line of the contact

+ + +

Parameters

+ + + + + + +
string$address_2

The new address for the contact

+ +

Throws

+
+
\PDOException
+

If something went wrong with the database

+
+ +

Returns

+ boolean + —

True on succes, false on failure

+ +
+
+ +
+ +
+
+ +
+

getPostalCode()

+ +
getPostalCode() : string
+

Get the postal_code of the contact

+ + + + +

Returns

+ string + —

The postal_code

+ +
+
+ +
+ +
+
+ +
+

setPostalCode()

+ +
setPostalCode(  $postal_code) : boolean
+

Set the postal code of the contact

+ + +

Parameters

+ + + + + + +
$postal_code

string The new postal code for the contact

+ +

Throws

+
+
\PDOException
+

If something went wrong with the database

+
+ +

Returns

+ boolean + —

True on succes, false on failure

+ +
+
+ +
+ +
+
+ +
+

getCity()

+ +
getCity() : string
+

Get the city of the contact

+ + + + +

Returns

+ string + —

The city

+ +
+
+ +
+ +
+
+ +
+

setCity()

+ +
setCity(string  $city) : boolean
+

Set the city of the contact

+ + +

Parameters

+ + + + + + +
string$city

The new city for the contact

+ +

Throws

+
+
\PDOException
+

If something went wrong with the database

+
+ +

Returns

+ boolean + —

True on succes, false on failure

+ +
+
+ +
+ +
+
+ +
+

getCountry()

+ +
getCountry() : string
+

Get the country of the contact

+ + + + +

Returns

+ string + —

The country

+ +
+
+ +
+ +
+
+ +
+

setCountry()

+ +
setCountry(string  $country) : boolean
+

Set the country of the contact

+ + +

Parameters

+ + + + + + +
string$country

The new country for the contact

+ +

Throws

+
+
\PDOException
+

If something went wrong with the database

+
+ +

Returns

+ boolean + —

True on succes, false on failure

+ +
+
+ +
+ +
+
+ +
+

getLanguage()

+ +
getLanguage() : string
+

Get the language of the contact

+ + + + +

Returns

+ string + —

The language

+ +
+
+ +
+ +
+
+ +
+

setLanguage()

+ +
setLanguage(string  $language) : boolean
+

Set the language of the contact

+ + +

Parameters

+ + + + + + +
string$language

The new language for the contact

+ +

Throws

+
+
\PDOException
+

If something went wrong with the database

+
+ +

Returns

+ boolean + —

True on succes, false on failure

+ +
+
+ +
+ +
+
+ +
+

delete()

+ +
delete() : boolean
+

Remove this contact from the database

+

If this doesn't succeed (i.e. false is returned), that means the contact was removed manually or by another instance of this class

+ + +

Throws

+
+
\PDOException
+

If something went wrong with the database

+
+ +

Returns

+ boolean + —

True on success, false on failure

+ +
+
+ +
+ +
+
+ +
+

createOffer()

+ +
createOffer() : \offer
+

Make a new offer for this contact

+ + + +

Throws

+
+
\PDOException
+

If something went wrong with the database

+
\Exception
+

If there was a problem with the input

+
+ +

Returns

+ \offer + —

A new instance of the offer class containing the new offer

+ +
+
+ +
+ +
+
+ + + + +
+ + + diff --git a/docs/classes/correspondence.html b/docs/classes/correspondence.html new file mode 100644 index 0000000..e765531 --- /dev/null +++ b/docs/classes/correspondence.html @@ -0,0 +1,682 @@ + + + + + + API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

\correspondence

+

An extension of FPDF to generate personalized correspondence PDFs

+ + + +
+

Summary

+
+
+ Methods +
+
+ Properties +
+
+ Constants +
+
+
+
+ _()
+ __construct()
+ SetLangauge()
+ SetContact()
+ CorrespondenceHeader()
+ _putinfo()
+
+
+ $contact
+ $language
+
+
+ HEAD_RED
+ HEAD_GREEN
+ HEAD_BLUE
+
+
+
+
+ No protected methods found +
+
+ $translations
+
+
+ N/A +
+
+
+
+ No private methods found +
+
+ No private properties found +
+
+ N/A +
+
+
+
+ +
+ + +
+
+

Constants

+
+ +
+ +
+
+ +
+

HEAD_RED

+
HEAD_RED
+

If you'd want, you could change these constants to encode an RGB colour for headings in your PDFs

+ +
+
+ +
+ +
+
+ +
+

HEAD_GREEN

+
HEAD_GREEN
+

+ +
+
+ +
+ +
+
+ +
+

HEAD_BLUE

+
HEAD_BLUE
+

+ +
+
+ +
+ + + +
+
+

Properties

+
+ +
+ +
+
+ +
+

$contact

+
$contact : 
+

+ + +

Type

+ + — Holds the contact this correspondence will be sent to
+
+ +
+ +
+
+ +
+

$language

+
$language : 
+

+ + +

Type

+ + — Holds the contact this correspondence will be sent to
+
+ +
+ +
+
+ +
+

$translations

+
$translations : 
+

Array holding the translations

+ + +

Type

+ +
+
+ +
+ + + +
+

Methods

+ +
+ +
+
+ +
+

_()

+ +
_(string  $key) : string
+

Translate a string

+ + +

Parameters

+ + + + + + +
string$key

The string to translate

+ + +

Returns

+ string + —

The translated string

+ +
+
+ +
+ +
+
+ +
+

__construct()

+ +
__construct(string  $orientation = 'P', string  $unit = 'mm', string  $size = 'A4') 
+

Create a new PDF

+ + +

Parameters

+ + + + + + + + + + + + + + + + +
string$orientation

See the FPDF class specs

string$unit

See the FPDF class specs

string$size

See the FPDF class specs

+ + + +
+
+ +
+ +
+
+ +
+

SetLangauge()

+ +
SetLangauge(string  $lang) 
+

Set the language of the correspondence (used to translate stuff)

+ + +

Parameters

+ + + + + + +
string$lang

The language, two letter code ('en', 'nl', ...)

+ + + +
+
+ +
+ +
+
+ +
+

SetContact()

+ +
SetContact(\contact  $contact) 
+

Set the contact to whom this correspondence will be sent (used for the address)

+ + +

Parameters

+ + + + + + +
\contact$contact

The contact

+ + + +
+
+ +
+ +
+
+ +
+

CorrespondenceHeader()

+ +
CorrespondenceHeader() 
+

Makes a header with your details and the address of the contact

+ + + + + +
+
+ +
+ +
+
+ +
+

_putinfo()

+ +
_putinfo() 
+

Put PDF information

+ + + + + +
+
+ +
+ +
+
+ + + + +
+ + + diff --git a/docs/classes/file.html b/docs/classes/file.html new file mode 100644 index 0000000..8149070 --- /dev/null +++ b/docs/classes/file.html @@ -0,0 +1,611 @@ + + + + + + API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

\file

+

An interface to the file table in the database

+ + + +
+

Summary

+
+
+ Methods +
+
+ Properties +
+
+ Constants +
+
+
+
+ __construct()
+ getId()
+ getFilename()
+ getFilenamePath()
+ getFilenameURI()
+ delete()
+
+
+ No public properties found +
+
+ No constants found +
+
+
+
+ No protected methods found +
+
+ $pdo
+ $id
+ $filename
+
+
+ N/A +
+
+
+
+ No private methods found +
+
+ No private properties found +
+
+ N/A +
+
+
+
+ +
+ + + +
+
+

Properties

+
+ +
+ +
+
+ +
+

$pdo

+
$pdo : \PDO
+

+ + +

Type

+ \PDO + — The PDO class for database communication
+
+ +
+ +
+
+ +
+

$id

+
$id : \PDO
+

+ + +

Type

+ \PDO + — The PDO class for database communication
+
+ +
+ +
+
+ +
+

$filename

+
$filename : \PDO
+

+ + +

Type

+ \PDO + — The PDO class for database communication
+
+ +
+ + + +
+

Methods

+ +
+ +
+
+ +
+

__construct()

+ +
__construct(\PDO  $pdo, integer  $id) 
+

Create a new instance

+ + +

Parameters

+ + + + + + + + + + + +
\PDO$pdo

The PDO class, to access the database

integer$id

The id of the file to fetch

+ +

Throws

+
+
\PDOException
+

If something went wrong with the database

+
\Exception
+

If the file could not be found

+
+ + +
+
+ +
+ +
+
+ +
+

getId()

+ +
getId() : integer
+

Get the ID of the file

+ + + + +

Returns

+ integer + —

The ID

+ +
+
+ +
+ +
+
+ +
+

getFilename()

+ +
getFilename() : string
+

Get the relative filename of the file

+ + + + +

Returns

+ string + —

The filename

+ +
+
+ +
+ +
+
+ +
+

getFilenamePath()

+ +
getFilenamePath() : string
+

Get the full internal path to the file

+ + + + +

Returns

+ string + —

The path

+ +
+
+ +
+ +
+
+ +
+

getFilenameURI()

+ +
getFilenameURI() : string
+

Get the full external path to the file

+ + + + +

Returns

+ string + —

The URI

+ +
+
+ +
+ +
+
+ +
+

delete()

+ +
delete() : boolean
+

Move this file to the trash and delete all records for it

+

Physically, this moves the file to a trash folder +Then, the file will be removed from the file table in the database +Any appendices linking to this file with fileId will have fileId NULL +Any offers linking to this file with invoice_fileId will have invoice_fileId NULL

+ + +

Throws

+
+
\PDOException
+

If there's something wrong with the database

+
+ +

Returns

+ boolean + —

True on success, false on failure

+ +
+
+ +
+ +
+
+ + + + +
+ + + diff --git a/docs/classes/offer.html b/docs/classes/offer.html new file mode 100644 index 0000000..454c86e --- /dev/null +++ b/docs/classes/offer.html @@ -0,0 +1,1491 @@ + + + + + + API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

\offer

+

An interface to the offer table in the database

+ + + +
+

Summary

+
+
+ Methods +
+
+ Properties +
+
+ Constants +
+
+
+
+ __construct()
+ getId()
+ getContactId()
+ getContact()
+ getAssignmentIds()
+ getAssignments()
+ getStartDate()
+ setStartDate()
+ getEndDate()
+ setEndDate()
+ getInvoiceDate()
+ setInvoiceDate()
+ getPaymentReceived()
+ setPaymentReceived()
+ isAccepted()
+ toggleAccepted()
+ getInvoiceFileId()
+ getInvoiceFile()
+ setInvoiceFileId()
+ calculate()
+ delete()
+ createAssignment()
+ generateInvoice()
+
+
+ No public properties found +
+
+ SUBTOTAL
+ VAT
+ TOTAL
+
+
+
+
+ No protected methods found +
+
+ $pdo
+ $id
+ $contactId
+ $start_date
+ $end_date
+ $invoice_date
+ $accepted
+ $invoice_fileId
+ $payment_received
+
+
+ N/A +
+
+
+
+ No private methods found +
+
+ No private properties found +
+
+ N/A +
+
+
+
+ +
+ + +
+
+

Constants

+
+ +
+ +
+
+ +
+

SUBTOTAL

+
SUBTOTAL
+

+ +
+
+ +
+ +
+
+ +
+

VAT

+
VAT
+

+ +
+
+ +
+ +
+
+ +
+

TOTAL

+
TOTAL
+

+ +
+
+ +
+ + + +
+
+

Properties

+
+ +
+ +
+
+ +
+

$pdo

+
$pdo : \pdo
+

+ + +

Type

+ \pdo + — The PDO class for database communication
+
+ +
+ +
+
+ +
+

$id

+
$id : \pdo
+

+ + +

Type

+ \pdo + — The PDO class for database communication
+
+ +
+ +
+
+ +
+

$contactId

+
$contactId : \pdo
+

+ + +

Type

+ \pdo + — The PDO class for database communication
+
+ +
+ +
+
+ +
+

$start_date

+
$start_date : \pdo
+

+ + +

Type

+ \pdo + — The PDO class for database communication
+
+ +
+ +
+
+ +
+

$end_date

+
$end_date : \pdo
+

+ + +

Type

+ \pdo + — The PDO class for database communication
+
+ +
+ +
+
+ +
+

$invoice_date

+
$invoice_date : \pdo
+

+ + +

Type

+ \pdo + — The PDO class for database communication
+
+ +
+ +
+
+ +
+

$accepted

+
$accepted : \pdo
+

+ + +

Type

+ \pdo + — The PDO class for database communication
+
+ +
+ +
+
+ +
+

$invoice_fileId

+
$invoice_fileId : \pdo
+

+ + +

Type

+ \pdo + — The PDO class for database communication
+
+ +
+ +
+
+ +
+

$payment_received

+
$payment_received : \pdo
+

+ + +

Type

+ \pdo + — The PDO class for database communication
+
+ +
+ + + +
+

Methods

+ +
+ +
+
+ +
+

__construct()

+ +
__construct(\PDO  $pdo, integer  $id) 
+

Create a new instance

+

Blah

+ +

Parameters

+ + + + + + + + + + + +
\PDO$pdo

The PDO class, to access the database

integer$id

The id of the offer to fetch

+ +

Throws

+
+
\PDOException
+

If something went wrong with the database

+
\Exception
+

If the offer could not be found

+
+ + +
+
+ +
+ +
+
+ +
+

getId()

+ +
getId() : integer
+

Get the ID of the offer

+ + + + +

Returns

+ integer + —

The ID

+ +
+
+ +
+ +
+
+ +
+

getContactId()

+ +
getContactId() : integer
+

Get the ID of the contact that this offer is linked to

+ + + + +

Returns

+ integer + —

The ID

+ +
+
+ +
+ +
+
+ +
+

getContact()

+ +
getContact() : \contact
+

Get the contact that this offer is linked to

+ + + + +

Returns

+ \contact + —

The contact

+ +
+
+ +
+ +
+
+ +
+

getAssignmentIds()

+ +
getAssignmentIds() : array<mixed,integer>
+

Get all assignment ids for this offer

+ + + +

Throws

+
+
\PDOException
+

Is something went wrong with the database

+
+ +

Returns

+ array<mixed,integer> + —

The ids

+ +
+
+ +
+ +
+
+ +
+

getAssignments()

+ +
getAssignments() : array<mixed,\assignment>
+

Get all assignments for this offer

+ + + +

Throws

+
+
\PDOException
+

If something went wrong with the database

+
+ +

Returns

+ array<mixed,\assignment> + —

An array indexed by id of instances of the assignment class

+ +
+
+ +
+ +
+
+ +
+

getStartDate()

+ +
getStartDate() : integer
+

Get the start date of the assignment

+ + + + +

Returns

+ integer + —

The start date as a UNIX timestamp

+ +
+
+ +
+ +
+
+ +
+

setStartDate()

+ +
setStartDate(integer  $start_date) : boolean
+

Set the start date of the assignment

+ + +

Parameters

+ + + + + + +
integer$start_date

The new start date for the assignment as a UNIX timestamp

+ +

Throws

+
+
\PDOException
+

If something went wrong with the database

+
+ +

Returns

+ boolean + —

True on succes, false on failure

+ +
+
+ +
+ +
+
+ +
+

getEndDate()

+ +
getEndDate() : integer
+

Get the end date of the assignment

+ + + + +

Returns

+ integer + —

The end date as a UNIX timestamp

+ +
+
+ +
+ +
+
+ +
+

setEndDate()

+ +
setEndDate(integer  $end_date) : boolean
+

Set the end date of the assignment

+ + +

Parameters

+ + + + + + +
integer$end_date

The new end date for the assignment as a UNIX timestamp

+ +

Throws

+
+
\PDOException
+

If something went wrong with the database

+
+ +

Returns

+ boolean + —

True on succes, false on failure

+ +
+
+ +
+ +
+
+ +
+

getInvoiceDate()

+ +
getInvoiceDate() : integer
+

Get the invoice date of the assignment

+ + + + +

Returns

+ integer + —

The invoice date as a UNIX timestamp

+ +
+
+ +
+ +
+
+ +
+

setInvoiceDate()

+ +
setInvoiceDate(integer  $invoice_date) : boolean
+

Set the invoice date of the assignment

+ + +

Parameters

+ + + + + + +
integer$invoice_date

The new invoice date for the assignment as a UNIX timestamp

+ +

Throws

+
+
\PDOException
+

If something went wrong with the database

+
+ +

Returns

+ boolean + —

True on succes, false on failure

+ +
+
+ +
+ +
+
+ +
+

getPaymentReceived()

+ +
getPaymentReceived() : integer|null
+

Get the date the payment was received

+ + + + +

Returns

+ integer|null + —

The date as a UNIX timestamp, or null if it wasn't received yet

+ +
+
+ +
+ +
+
+ +
+

setPaymentReceived()

+ +
setPaymentReceived(integer  $payment_received) : boolean
+

Set the payment received date of the assignment

+ + +

Parameters

+ + + + + + +
integer$payment_received

The new date the payment has been received as a UNIX timestamp

+ +

Throws

+
+
\PDOException
+

If something went wrong with the database

+
+ +

Returns

+ boolean + —

True on succes, false on failure

+ +
+
+ +
+ +
+
+ +
+

isAccepted()

+ +
isAccepted() : boolean
+

Check if the offer is accepted or not

+ + + + +

Returns

+ boolean + —

True if the offer is accepted, false if not

+ +
+
+ +
+ +
+
+ +
+

toggleAccepted()

+ +
toggleAccepted() : boolean
+

Toggle the `accepted' status of the offer

+ + + +

Throws

+
+
\PDOException
+

If something went wrong with the database

+
+ +

Returns

+ boolean + —

True on success, false on failure

+ +
+
+ +
+ +
+
+ +
+

getInvoiceFileId()

+ +
getInvoiceFileId() : integer
+

Get the ID of the file that the invoice of this offer is linked to

+ + + + +

Returns

+ integer + —

The ID

+ +
+
+ +
+ +
+
+ +
+

getInvoiceFile()

+ +
getInvoiceFile() : \file|null
+

Get the file that the invoice this offer is linked to

+ + + + +

Returns

+ \file|null + —

The file, or null if it doesn't exist

+ +
+
+ +
+ +
+
+ +
+

setInvoiceFileId()

+ +
setInvoiceFileId(integer  $invoice_fileId) : boolean
+

Set the invoice file id of the assignment

+ + +

Parameters

+ + + + + + +
integer$invoice_fileId

The new invoice file id for the assignment

+ +

Throws

+
+
\PDOException
+

If something went wrong with the database

+
+ +

Returns

+ boolean + —

True on succes, false on failure

+ +
+
+ +
+ +
+
+ +
+

calculate()

+ +
calculate(integer  $what = self::TOTAL, integer  $round = 2, boolean  $format = true) : float|boolean
+

Calculate a handy number about the invoice

+

Subtotal: the sum of the prices of the assignments excl. VAT

+

VAT: the sum of all the VAT from all the assignments

+

Total: the sum of subtotal and total

+ +

Parameters

+ + + + + + + + + + + + + + + + +
integer$what

Any of offer::SUBTOTAL, offer::VAT and offer::TOTAL

integer$round

How many decimals to round the result on

boolean$format

Whether to format the number nicely (for output) or not (for calculations)

+ +

Throws

+
+
\PDOException
+

If something went wrong with the database

+
+ +

Returns

+ float|boolean + —

The calculated value rounded to $round decimals, or false on incorrect input

+ +
+
+ +
+ +
+
+ +
+

delete()

+ +
delete() : boolean
+

Remove this offer from the database

+

If this doesn't succeed (i.e. false is returned), that means the offer was removed manually or by another instance of this class

+ + +

Throws

+
+
\PDOException
+

If something went wrong with the database

+
+ +

Returns

+ boolean + —

True on success, false on failure

+ +
+
+ +
+ +
+
+ +
+

createAssignment()

+ +
createAssignment(string  $title, string  $description, integer  $hours, float  $price_per_hour, float  $vat) : \assignment
+

Make a new assignment linked to this order

+ + +

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
string$title

The title for this assignment

string$description

The description for this assignment

integer$hours

The amount of hours to work on this assignment

float$price_per_hour

The price per hour on this assignment

float$vat

The VAT percentage (so, 21 for 21%, not 0.21!)

+ +

Throws

+
+
\PDOException
+

If something went wrong with the database

+
\Exception
+

If there was a problem with the input

+
+ +

Returns

+ \assignment + —

A new instance of the assignment class containing the new assignment

+ +
+
+ +
+ +
+
+ +
+

generateInvoice()

+ +
generateInvoice() : \file
+

Generate a PDF invoice

+ + + +

Throws

+
+
\PDOException
+

If something went wrong with the database

+
\Exception
+

If the file could not be written or an other error occured

+
+ +

Returns

+ \file + —

An instance of the file class with information on the invoice file generated

+ +
+
+ +
+ +
+
+ + + + +
+ + + diff --git a/docs/classes/response.html b/docs/classes/response.html new file mode 100644 index 0000000..44b579c --- /dev/null +++ b/docs/classes/response.html @@ -0,0 +1,618 @@ + + + + + + API Documentation + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +

\response

+

Provides a standard to base all responses to be called with AJAX on

+ + + +
+

Summary

+
+
+ Methods +
+
+ Properties +
+
+ Constants +
+
+
+
+ __construct()
+ __set()
+ __get()
+ __isset()
+ __unset()
+ http_response_code()
+ getJson()
+
+
+ No public properties found +
+
+ No constants found +
+
+
+
+ No protected methods found +
+
+ No protected properties found +
+
+ N/A +
+
+
+
+ No private methods found +
+
+ $response
+ $http_response_code
+
+
+ N/A +
+
+
+
+ +
+ + + +
+
+

Properties

+
+ +
+ +
+
+ +
+

$response

+
$response : 
+

The variable to keep the response in until output

+ + +

Type

+ +
+
+ +
+ +
+
+ +
+

$http_response_code

+
$http_response_code : 
+

The variable to keep the HTTP response code in until output

+ + +

Type

+ +
+
+ +
+ + + +
+

Methods

+ +
+ +
+
+ +
+

__construct()

+ +
__construct() 
+

Create a new instance

+ + + + + +
+
+ +
+ +
+
+ +
+

__set()

+ +
__set(string  $name, string  $value) 
+

Set a variable of the response

+ + +

Parameters

+ + + + + + + + + + + +
string$name

The name of the variable to set

string$value

The (new) value for the variable

+ + + +
+
+ +
+ +
+
+ +
+

__get()

+ +
__get(string  $name) : mixed
+

Get a variable of the response

+ + +

Parameters

+ + + + + + +
string$name

The name of the variable to get

+ + +

Returns

+ mixed + —

The value of the variable

+ +
+
+ +
+ +
+
+ +
+

__isset()

+ +
__isset(string  $name) : boolean
+

Check if a variable of the response is set

+ + +

Parameters

+ + + + + + +
string$name

The name of the variable to check

+ + +

Returns

+ boolean + —

True if the variable exists, false otherwise

+ +
+
+ +
+ +
+
+ +
+

__unset()

+ +
__unset(string  $name) 
+

Unset a variable of the response

+ + +

Parameters

+ + + + + + +
string$name

The variable to unset

+ + + +
+
+ +
+ +
+
+ +
+

http_response_code()

+ +
http_response_code(integer  $code = null) : integer|boolean
+

Get or set the HTTP response code

+

If a parameter is provided, it is used as the new HTTP response code, and a bool is returned for success or failure. Otherwise, the current one is returned.

+ +

Parameters

+ + + + + + +
integer$code

The new code

+ + +

Returns

+ integer|boolean + —

True on successful change, false on unsuccesful change, int when the current code is returned

+ +
+
+ +
+ +
+
+ +
+

getJson()

+ +
getJson() : string
+

Output the response in json

+ + + + +

Returns

+ string + —

The response in json format

+ +
+
+ +
+ +
+
+ + + + +
+ + + -- cgit v1.2.3