SUBTOTAL
+SUBTOTAL+
+ +
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/assignment.html | 1195 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1195 insertions(+) create mode 100644 docs/classes/assignment.html (limited to 'docs/classes/assignment.html') 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 @@ + + +
+ + +An interface to the assignment table in the database
+ + + +__construct(\PDO $pdo, integer $id)+
Create a new instance
+ + +| \PDO+ | $pdo+ | +The PDO class, to access the database | 
| integer+ | $id+ | +The id of the assignment to fetch | 
If something went wrong with the database
If the assignment could not be found
getOffer() : \offer+
Get the offer that this assignment is linked to
+ + + + +The offer
+ +setTitle(string  $title) : boolean
+                Set the title of the assignment
+ + +| string+ | $title+ | +The new title for the assignment | 
If something went wrong with the database
True on succes, false on failure
+ +setDescription(string  $description) : boolean
+                Set the description of the assignment
+ + +| string+ | $description+ | +The new description for the assignment | 
If something went wrong with the database
True on succes, false on failure
+ +setHours(integer  $hours) : boolean
+                Set the amount of hours of the assignment
+ + +| integer+ | $hours+ | +The new amount hours for the assignment | 
If something went wrong with the database
True on succes, false on failure
+ +setPricePerHour(float  $price_per_hour) : boolean
+                Set the price per hour of the assignment
+ + +| float+ | $price_per_hour+ | +The new price per hour for the assignment | 
If something went wrong with the database
True on succes, false on failure
+ +setVAT(float  $vat) : boolean
+                Set the VAT percentage of the assignment
+ + +| float+ | $vat+ | +The new VAT percentage for the assignment | 
If something went wrong with the database
True on succes, false on failure
+ +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
+ +| 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) | 
If something went wrong with the database
The calculated value rounded on $round decimals, or false when the input is incorrect
+ +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
+ + +If something went wrong with the database
True on success, false on failure
+ +