Record.php 834 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * Lithium: the most rad php framework
  4. *
  5. * @copyright Copyright 2013, Union of RAD (http://union-of-rad.org)
  6. * @license http://opensource.org/licenses/bsd-license.php The BSD License
  7. */
  8. namespace lithium\data\entity;
  9. /**
  10. * `Record` class. Represents data such as a row from a database. Records have fields (often known
  11. * as columns in databases).
  12. */
  13. class Record extends \lithium\data\Entity {
  14. /**
  15. * Converts a `Record` object to another specified format.
  16. *
  17. * @param string $format The format used by default is `array`
  18. * @param array $options
  19. * @return mixed
  20. */
  21. public function to($format, array $options = array()) {
  22. $defaults = array('handlers' => array(
  23. 'stdClass' => function($item) { return $item; }
  24. ));
  25. $options += $defaults;
  26. return parent::to($format, $options);
  27. }
  28. }
  29. ?>