Source for file SqlBuilderLogUtils.php

Documentation is available at SqlBuilderLogUtils.php

  1. <?php
  2. /*
  3. * This file is part of Sylar.
  4. *
  5. * Sylar is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU Lesser General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * Sylar is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU Lesser General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Lesser General Public License
  16. * along with Sylar. If not, see <http://www.gnu.org/licenses/>.
  17. *
  18. * @copyright Copyright Sylar Development Team
  19. * @license http://www.gnu.org/licenses/ GNU Public License V2.0
  20. * @see https://launchpad.net/sylar/
  21. * @see http://www.giano-solutions.com
  22. */
  23. import('sylar.common.db.SqlStatement');
  24.  
  25. /**
  26. * Example Class Log Utils
  27. *
  28. * An example class to use Db to extract data about logging in DB
  29. *
  30. * @package Sylar
  31. * @version 1.0
  32. * @since 04/mar/08
  33. * @author Gianluca Giusti [brdp] <g.giusti@giano-solutions.com>
  34. * @copyright Sylar Development Team
  35. */
  36. class SqlBuilderLogUtils extends Sylar_SqlStatement{
  37. function __construct(){
  38. // nothing to do at the moment
  39. }
  40. function __destruct(){
  41. // nothing to do at the moment
  42. }
  43.  
  44. /**
  45. * Example Method
  46. *
  47. * @param $numOfEvents $numOfEvents
  48. * @return string
  49. */
  50. public function extractLastEvents($numOfEvents){
  51. // You can apply all formatting to generate sql query
  52. return "SELECT event_id, level_desc, event_desc FROM SYLAR_event_log ORDER BY rand() LIMIT 0,".$numOfEvents;
  53. }
  54. }
  55.  
  56. ?>

Documentation generated on Thu, 24 Apr 2008 16:14:22 +0200 by phpDocumentor 1.3.0RC3