Title.php 914 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Tax\Model\ResourceModel\Calculation\Rate;
  7. /**
  8. * Tax Rate Title Collection
  9. *
  10. * @author Magento Core Team <core@magentocommerce.com>
  11. */
  12. class Title extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
  13. {
  14. /**
  15. * Resource initialization
  16. *
  17. * @return void
  18. */
  19. protected function _construct()
  20. {
  21. $this->_init('tax_calculation_rate_title', 'tax_calculation_rate_title_id');
  22. }
  23. /**
  24. * Delete title by rate identifier
  25. *
  26. * @param int $rateId
  27. * @return $this
  28. */
  29. public function deleteByRateId($rateId)
  30. {
  31. $conn = $this->getConnection();
  32. $where = $conn->quoteInto('tax_calculation_rate_id = ?', (int)$rateId);
  33. $conn->delete($this->getMainTable(), $where);
  34. return $this;
  35. }
  36. }