MockModelCompositePk.php 808 B

12345678910111213141516171819202122232425262728293031323334
  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;
  9. use lithium\tests\mocks\data\source\database\adapter\MockAdapter;
  10. class MockModelCompositePk extends \lithium\data\Model {
  11. public static function __init() {}
  12. public static function &connection($records = null) {
  13. $mock = new MockAdapter(compact('records') + array(
  14. 'columns' => array(
  15. 'lithium\tests\mocks\data\MockModelCompositePk' => array(
  16. 'client_id', 'invoice_id', 'payment'
  17. )
  18. ),
  19. 'autoConnect' => false
  20. ));
  21. static::meta(array(
  22. 'key' => array('client_id', 'invoice_id'),
  23. 'locked' => true
  24. ));
  25. return $mock;
  26. }
  27. }
  28. ?>