SourceProviderInterface.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\App\ResourceConnection;
  7. /**
  8. * @api
  9. * @since 100.0.2
  10. */
  11. interface SourceProviderInterface extends \Traversable
  12. {
  13. /**
  14. * Returns main table name - extracted from "module/table" style and
  15. * validated by db adapter
  16. *
  17. * @return string
  18. */
  19. public function getMainTable();
  20. /**
  21. * Get primary key field name
  22. *
  23. * @throws \Magento\Framework\Exception\LocalizedException
  24. * @return string
  25. */
  26. public function getIdFieldName();
  27. /**
  28. * @param string $fieldName
  29. * @param null|string $alias
  30. * @return $this
  31. */
  32. public function addFieldToSelect($fieldName, $alias = null);
  33. /**
  34. * Get \Magento\Framework\DB\Select instance and applies fields to select if needed
  35. *
  36. * @return \Magento\Framework\DB\Select
  37. */
  38. public function getSelect();
  39. /**
  40. * Wrapper for compatibility with \Magento\Framework\Data\Collection\AbstractDb
  41. *
  42. * @param mixed $attribute
  43. * @param mixed $condition
  44. * @return $this|\Magento\Framework\Data\Collection\AbstractDb
  45. */
  46. public function addFieldToFilter($attribute, $condition = null);
  47. }