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/client.html | 731 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 731 insertions(+) create mode 100644 docs/classes/client.html (limited to 'docs/classes/client.html') 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

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