MockHttpModel.php 924 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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\tests\mocks\data\source;
  9. use lithium\data\source\Http;
  10. class MockHttpModel extends \lithium\data\Model {
  11. protected $_meta = array(
  12. 'source' => 'posts',
  13. 'connection' => false
  14. );
  15. public static $connection = null;
  16. protected $_schema = array(
  17. 'id' => array('type' => 'integer', 'key' => 'primary'),
  18. 'author_id' => array('type' => 'integer'),
  19. 'title' => array('type' => 'string', 'length' => 255),
  20. 'body' => array('type' => 'text'),
  21. 'created' => array('type' => 'datetime'),
  22. 'updated' => array('type' => 'datetime')
  23. );
  24. public static function &connection() {
  25. if (static::$connection) {
  26. return static::$connection;
  27. }
  28. $result = new Http();
  29. return $result;
  30. }
  31. }
  32. ?>