DbCollection.php 985 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\Data\Test\Unit\Collection;
  7. /**
  8. * Concrete implementation of abstract collection, created for abstract collection testing purposes.
  9. */
  10. class DbCollection extends \Magento\Framework\Data\Collection\AbstractDb
  11. {
  12. /**
  13. * @var \Magento\Framework\Model\ResourceModel\Db\AbstractDb
  14. */
  15. private $resource;
  16. /**
  17. * Set DB resource for testing purposes.
  18. *
  19. * @param \Magento\Framework\Model\ResourceModel\Db\AbstractDb $resource
  20. * @return $this
  21. */
  22. public function setResource(\Magento\Framework\Model\ResourceModel\Db\AbstractDb $resource)
  23. {
  24. $this->resource = $resource;
  25. return $this;
  26. }
  27. /**
  28. * Get resource instance.
  29. *
  30. * @return \Magento\Framework\Model\ResourceModel\Db\AbstractDb
  31. */
  32. public function getResource()
  33. {
  34. return $this->resource;
  35. }
  36. }