Entity.php 706 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\Indexer\Action;
  7. use Magento\Framework\App\ResourceConnection\SourceProviderInterface;
  8. class Entity extends Base
  9. {
  10. /**
  11. * @var string
  12. */
  13. protected $tableAlias = 'e';
  14. /**
  15. * Prepare select query
  16. *
  17. * @param array|int|null $ids
  18. * @return SourceProviderInterface
  19. */
  20. protected function prepareDataSource(array $ids = [])
  21. {
  22. return !count($ids)
  23. ? $this->createResultCollection()
  24. : $this->createResultCollection()->addFieldToFilter($this->getPrimaryResource()->getIdFieldName(), $ids);
  25. }
  26. }