aboutsummaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
Diffstat (limited to 'classes')
-rw-r--r--classes/Assignment.php2
-rw-r--r--classes/Calculatable.php7
-rw-r--r--classes/Client.php1
-rw-r--r--classes/Contact.php6
-rw-r--r--classes/Discount.php2
-rw-r--r--classes/File.php1
-rw-r--r--classes/Model.php2
-rw-r--r--classes/Offer.php11
-rw-r--r--classes/OfferItem.php1
-rw-r--r--classes/Payment.php11
-rw-r--r--classes/User.php6
11 files changed, 49 insertions, 1 deletions
diff --git a/classes/Assignment.php b/classes/Assignment.php
index 91f430a..af689fb 100644
--- a/classes/Assignment.php
+++ b/classes/Assignment.php
@@ -27,10 +27,12 @@
class Assignment extends OfferItem {
use StandardCalculatable;
+ /** {@inheritDoc} */
public
$table = 'assignment',
$fillable_columns = ['offerId', 'title', 'description', 'hours', 'price_per_hour', 'VAT_percentage'];
+ /** {@inheritDoc} */
public function calculateSubtotal() {
return $this->hours * $this->price_per_hour;
}
diff --git a/classes/Calculatable.php b/classes/Calculatable.php
index 76f89eb..2a6afea 100644
--- a/classes/Calculatable.php
+++ b/classes/Calculatable.php
@@ -75,7 +75,14 @@ interface Calculatable {
* total can be calculated
*/
trait StandardCalculatable {
+ /**
+ * {@inheritDoc}
+ */
abstract public function calculateSubtotal();
+
+ /**
+ * {@inheritDoc}
+ */
abstract public function calculateVAT();
/**
diff --git a/classes/Client.php b/classes/Client.php
index 13e28d7..7c9cd1e 100644
--- a/classes/Client.php
+++ b/classes/Client.php
@@ -25,6 +25,7 @@
* An interface to the client table in the database
*/
class Client extends Model {
+ /** {@inheritDoc} */
public
$table = 'client',
$fillable_columns = ['name'];
diff --git a/classes/Contact.php b/classes/Contact.php
index ed2a80d..6ab4803 100644
--- a/classes/Contact.php
+++ b/classes/Contact.php
@@ -25,10 +25,16 @@
* An interface to the contact table in the database
*/
class Contact extends Model {
+ /** {@inheritDoc} */
public
$table = 'contact',
$fillable_columns = ['clientId', 'name', 'email', 'address', 'address_2', 'postal_code', 'city', 'country', 'language'];
+ /**
+ * {@inheritDoc}
+ * @param $key {@inheritDoc}
+ * @param $value {@inheritDoc}
+ */
protected function mutator($key, $value) {
switch ($key) {
case 'language':
diff --git a/classes/Discount.php b/classes/Discount.php
index e4f8067..f7dcf3b 100644
--- a/classes/Discount.php
+++ b/classes/Discount.php
@@ -27,10 +27,12 @@
class Discount extends OfferItem {
use StandardCalculatable;
+ /** {@inheritDoc} */
public
$table = 'discount',
$fillable_columns = ['offerId', 'title', 'description', 'value', 'VAT_percentage'];
+ /** {@inheritDoc} */
public function calculateSubtotal() {
return - $this->value;
}
diff --git a/classes/File.php b/classes/File.php
index 4a28f80..e400d25 100644
--- a/classes/File.php
+++ b/classes/File.php
@@ -25,6 +25,7 @@
* An interface to the file table in the database
*/
class File extends Model {
+ /** {@inheritDoc} */
public
$table = 'file',
$fillable_columns = ['filename', 'secret_key'];
diff --git a/classes/Model.php b/classes/Model.php
index 018dae4..6ee7821 100644
--- a/classes/Model.php
+++ b/classes/Model.php
@@ -124,7 +124,7 @@ abstract class Model {
* @param string $key The column
* @param string $value The value
*
- * @return string The modified value (default: $value)
+ * @return mixed The modified value (default: $value)
*/
protected function accessor($key, $value) {
return $value;
diff --git a/classes/Offer.php b/classes/Offer.php
index 8fa9ba7..16e0d20 100644
--- a/classes/Offer.php
+++ b/classes/Offer.php
@@ -25,10 +25,16 @@
* An interface to the offer table in the database
*/
class Offer extends Model{
+ /** {@inheritDoc} */
public
$table = 'offer',
$fillable_columns = ['contactId', 'start_date', 'end_date', 'invoice_date', 'accepted', 'invoice_fileId', 'payment_key'];
+ /**
+ * {@inheritDoc}
+ * @param $key {@inheritDoc}
+ * @param $value {@inheritDoc}
+ */
protected function accessor($key, $value) {
switch ($key) {
case 'start_date':
@@ -45,6 +51,11 @@ class Offer extends Model{
}
}
+ /**
+ * {@inheritDoc}
+ * @param $key {@inheritDoc}
+ * @param $value {@inheritDoc}
+ */
protected function mutator($key, $value) {
switch ($key) {
case 'start_date':
diff --git a/classes/OfferItem.php b/classes/OfferItem.php
index 5753eb2..a412eaf 100644
--- a/classes/OfferItem.php
+++ b/classes/OfferItem.php
@@ -45,6 +45,7 @@ abstract class OfferItem extends Model implements Calculatable {
return $pd->text($this->description);
}
+ /** {@inheritDoc} */
public function calculateVAT() {
return $this->calculateSubtotal() * $this->VAT_percentage / 100;
}
diff --git a/classes/Payment.php b/classes/Payment.php
index 5bc08dc..4b8c12b 100644
--- a/classes/Payment.php
+++ b/classes/Payment.php
@@ -25,6 +25,7 @@
* An interface to the payment table in the database
*/
class Payment extends Model {
+ /** {@inheritDoc} */
public
$table = 'payment',
$fillable_columns = ['offerId', 'date', 'braintree_id'];
@@ -38,6 +39,11 @@ class Payment extends Model {
return new Offer($this->pdo, $this->offerId);
}
+ /**
+ * {@inheritDoc}
+ * @param $key {@inheritDoc}
+ * @param $value {@inheritDoc}
+ */
protected function accessor($key, $value) {
switch ($key) {
case 'date':
@@ -48,6 +54,11 @@ class Payment extends Model {
}
}
+ /**
+ * {@inheritDoc}
+ * @param $key {@inheritDoc}
+ * @param $value {@inheritDoc}
+ */
protected function mutator($key, $value) {
switch ($key) {
case 'date':
diff --git a/classes/User.php b/classes/User.php
index e3d3f1a..33396db 100644
--- a/classes/User.php
+++ b/classes/User.php
@@ -25,6 +25,7 @@
* An interface to the user table in the database
*/
class User extends Model {
+ /** {@inheritDoc} */
public
$table = 'user',
$fillable_columns = ['username', 'password'];
@@ -55,6 +56,11 @@ class User extends Model {
);
}
+ /**
+ * {@inheritDoc}
+ * @param $key {@inheritDoc}
+ * @param $value {@inheritDoc}
+ */
public function mutator($key, $value) {
switch ($key) {
case 'password':