ConversionId.php 876 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * Google AdWords Conversion Id Backend model
  4. *
  5. * Copyright © Magento, Inc. All rights reserved.
  6. * See COPYING.txt for license details.
  7. */
  8. namespace Magento\GoogleAdwords\Model\Config\Backend;
  9. /**
  10. * @api
  11. * @since 100.0.2
  12. */
  13. class ConversionId extends \Magento\GoogleAdwords\Model\Config\Backend\AbstractConversion
  14. {
  15. /**
  16. * Validation rule conversion id
  17. *
  18. * @return \Zend_Validate_Interface|null
  19. */
  20. protected function _getValidationRulesBeforeSave()
  21. {
  22. $this->_validatorComposite->addRule(
  23. $this->_validatorFactory->createConversionIdValidator($this->getValue()),
  24. 'conversion_id'
  25. );
  26. return $this->_validatorComposite;
  27. }
  28. /**
  29. * Get tested value
  30. *
  31. * @return string
  32. */
  33. public function getConversionId()
  34. {
  35. return $this->getValue();
  36. }
  37. }