. * */ /* * * The following SQL statement is just a help for developers and will not be * executed! * * CREATE TABLE `log` ( * `id` INT PRIMARY KEY AUTO INCREMENT, * `timestamp` DATETIME NOT NULL, * `appid` VARCHAR( 255 ) NOT NULL , * `subject` VARCHAR( 255 ), * `predicate` VARCHAR( 255 ), * `object` TEXT * ) * */ /** * This class is for logging */ class OC_LOG { /** * @brief adds an entry to the log * @param $appid id of the app * @param $subject username * @param $predicate action * @param $object = null; additional information * @returns true/false * * This function adds another entry to the log database */ public static function add( $subject, $predicate, $object = null ){ // TODO: write function return true; } /** * @brief Fetches log entries * @param $filter = array(); array with filter options * @returns array with entries * * This function fetches the log entries according to the filter options * passed. * * $filter is an associative array. * The following keys are optional: * - from: all entries after this date * - until: all entries until this date * - user: username (default: current user) * - app: only entries for this app */ public static function get( $filter = array()){ // TODO: write function return array(); } /** * @brief removes log entries * @param $date delete entries older than this date * @returns true/false * * This function deletes all entries that are older than $date. */ public static function deleteBefore( $date ){ // TODO: write function return true; } } ?>