Collection.php 907 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Sitemap\Model\ResourceModel\Sitemap;
  7. /**
  8. * Sitemap resource model collection
  9. *
  10. * @author Magento Core Team <core@magentocommerce.com>
  11. * @api
  12. * @since 100.0.2
  13. */
  14. class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
  15. {
  16. /**
  17. * Init collection
  18. *
  19. * @return void
  20. */
  21. public function _construct()
  22. {
  23. $this->_init(\Magento\Sitemap\Model\Sitemap::class, \Magento\Sitemap\Model\ResourceModel\Sitemap::class);
  24. }
  25. /**
  26. * Filter collection by specified store ids
  27. *
  28. * @param array|int[] $storeIds
  29. * @return $this
  30. */
  31. public function addStoreFilter($storeIds)
  32. {
  33. $this->getSelect()->where('main_table.store_id IN (?)', $storeIds);
  34. return $this;
  35. }
  36. }