6550eca55471674c9d20fa2a666ad33c966a53c4
[mailer.git] / inc / classes / interfaces / database / class_FrameworkDatabaseInterface.php
1 <?php
2 /**
3  * The general interface for all other database interfaces
4  *
5  * @author      Roland Haeder <roland __NOSPAM__ [at] __REMOVE_ME__ mxchange [dot] org>
6  * @version     0.1
7  */
8 interface FrameworkDatabaseInterface extends FrameworkInterface {
9         /**
10          * Saves a whole object by serializing it entirely or some specifyable
11          * parts. Specifying parts must be done before this method is called. If
12          * it is not done this method will serialize the whole object.
13          *
14          * @param               $object An instance to the object we want to save
15          * @return      void
16          * @see         limitObject(ObjectLimits)       limitObject
17          */
18         function saveObject ($object);
19
20         /**
21          * Analyses if a unique ID has already been used or not. This method does
22          * only pass the given ID through to the "real" database layer.
23          *
24          * @param               $uniqueID               A unique ID number which shall be checked
25          *                                              before it will be used
26          * @param               $inConstructor  If called from a constructor or from
27          *                                              somewhere else
28          * @return      $isUnused               true    = The unique ID was not found in the database,
29          *                                              false = It is already in use by an other object
30          * @throws      NullPointerException    If $dbInstance is null
31          * @throws      NoObjectException               If $dbInstance is not an object
32          * @throws      MissingMethodException  If the required method
33          *                                                              isUniqueIdUsed() was not found
34          */
35         function isUniqueIdUsed ($uniqueID, $inConstructor = false);
36
37         /**
38          * Gets cached data from the database layer and if not found fetch it from
39          * the database again. This method does not return the header stuff because
40          * The underlaying database class will return only the requested content.
41          *
42          * @param               $idNumber               The ID number which we need for looking up
43          *                                              the requested data
44          * @return      $cachedArray    The maybe cached data from the database
45          * @throws      NullPointerException    If $dbInstance is null
46          * @throws      NoObjectException               If $dbInstance is not an object
47          * @throws      MissingMethodException  If the required method
48          *                                                              isUniqueIdUsed() was not found
49          */
50         function getObjectFromCachedData ($idNumber);
51 }
52
53 // [EOF]
54 ?>