Customer.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\SalesRule\Model\Rule;
  7. /**
  8. * SalesRule Rule Customer Model
  9. *
  10. * @method int getRuleId()
  11. * @method \Magento\SalesRule\Model\Rule\Customer setRuleId(int $value)
  12. * @method int getCustomerId()
  13. * @method \Magento\SalesRule\Model\Rule\Customer setCustomerId(int $value)
  14. * @method int getTimesUsed()
  15. * @method \Magento\SalesRule\Model\Rule\Customer setTimesUsed(int $value)
  16. *
  17. * @author Magento Core Team <core@magentocommerce.com>
  18. */
  19. class Customer extends \Magento\Framework\Model\AbstractModel
  20. {
  21. /**
  22. * Constructor
  23. *
  24. * @return void
  25. */
  26. protected function _construct()
  27. {
  28. parent::_construct();
  29. $this->_init(\Magento\SalesRule\Model\ResourceModel\Rule\Customer::class);
  30. }
  31. /**
  32. * Load by customer rule
  33. *
  34. * @param int $customerId
  35. * @param int $ruleId
  36. * @return $this
  37. */
  38. public function loadByCustomerRule($customerId, $ruleId)
  39. {
  40. $this->_getResource()->loadByCustomerRule($this, $customerId, $ruleId);
  41. return $this;
  42. }
  43. }