MockMongoPost.php 760 B

1234567891011121314151617181920212223242526272829
  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\mongo_db\Schema;
  10. class MockMongoPost extends \lithium\tests\mocks\data\MockBase {
  11. protected $_meta = array('source' => 'posts', 'connection' => false, 'key' => '_id');
  12. public static $connection;
  13. public static function schema($field = null) {
  14. $result = parent::schema($field);
  15. if (is_object($result) && get_class($result) === 'lithium\data\Schema') {
  16. return new Schema(array('fields' => $result->fields(), 'meta' => $result->meta()));
  17. }
  18. return $result;
  19. }
  20. }
  21. ?>