Format.php 927 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Directory\Model\ResourceModel\Country;
  7. /**
  8. * Directory country format resource model
  9. *
  10. * @api
  11. * @since 100.0.2
  12. */
  13. class Format extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
  14. {
  15. /**
  16. * Resource initialization
  17. *
  18. * @return void
  19. */
  20. protected function _construct()
  21. {
  22. $this->_init('directory_country_format', 'country_format_id');
  23. }
  24. /**
  25. * Initialize unique fields
  26. *
  27. * @return \Magento\Directory\Model\ResourceModel\Country\Format
  28. */
  29. protected function _initUniqueFields()
  30. {
  31. $this->_uniqueFields = [
  32. [
  33. 'field' => ['country_id', 'type'],
  34. 'title' => __('Country and Format Type combination should be unique'),
  35. ],
  36. ];
  37. return $this;
  38. }
  39. }