AbstractCollectionStub.php 759 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Eav\Test\Unit\Model\Entity\Collection;
  7. class AbstractCollectionStub extends \Magento\Eav\Model\Entity\Collection\AbstractCollection
  8. {
  9. /**
  10. * Retrieve item by id
  11. *
  12. * @param mixed $id
  13. * @return \Magento\Framework\DataObject
  14. */
  15. public function getItemById($id)
  16. {
  17. if (isset($this->_itemsById[$id])) {
  18. return $this->_itemsById[$id];
  19. }
  20. return null;
  21. }
  22. /**
  23. * Initialize collection
  24. *
  25. * @return void
  26. */
  27. protected function _construct()
  28. {
  29. return $this->_init(\Magento\Framework\DataObject::class, 'test_entity_model');
  30. }
  31. }