Exemplo n.º 1
0
 static function addEntry($object_id, $action_id, $description, $user_id, $table)
 {
     if (!is_numeric($object_id)) {
         return FALSE;
     }
     if ($action_id == '') {
         return FALSE;
     }
     if ($user_id == '') {
         global $current_user;
         if (is_object($current_user)) {
             $user_id = $current_user->getId();
         } else {
             $user_id = 0;
         }
     }
     if ($table == '') {
         return FALSE;
     }
     $lf = new LogFactory();
     $lf->setObject($object_id);
     $lf->setAction($action_id);
     $lf->setTableName($table);
     $lf->setUser((int) $user_id);
     $lf->setDescription($description);
     //Debug::text('Object ID: '. $object_id .' Action ID: '. $action_id .' Table: '. $table .' Description: '. $description, __FILE__, __LINE__, __METHOD__, 10);
     if ($lf->isValid() === TRUE) {
         $lf->Save();
         return TRUE;
     }
     return FALSE;
 }