Rules.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Authorization\Model;
  7. /**
  8. * Admin Rules Model
  9. *
  10. * @method int getRoleId()
  11. * @method \Magento\Authorization\Model\Rules setRoleId(int $value)
  12. * @method string getResourceId()
  13. * @method \Magento\Authorization\Model\Rules setResourceId(string $value)
  14. * @method string getPrivileges()
  15. * @method \Magento\Authorization\Model\Rules setPrivileges(string $value)
  16. * @method int getAssertId()
  17. * @method \Magento\Authorization\Model\Rules setAssertId(int $value)
  18. * @method string getPermission()
  19. * @method \Magento\Authorization\Model\Rules setPermission(string $value)
  20. * @api
  21. * @since 100.0.2
  22. */
  23. class Rules extends \Magento\Framework\Model\AbstractModel
  24. {
  25. /**
  26. * Class constructor
  27. *
  28. * @param \Magento\Framework\Model\Context $context
  29. * @param \Magento\Framework\Registry $registry
  30. * @param \Magento\Authorization\Model\ResourceModel\Rules $resource
  31. * @param \Magento\Authorization\Model\ResourceModel\Rules\Collection $resourceCollection
  32. * @param array $data
  33. */
  34. public function __construct(
  35. \Magento\Framework\Model\Context $context,
  36. \Magento\Framework\Registry $registry,
  37. \Magento\Authorization\Model\ResourceModel\Rules $resource,
  38. \Magento\Authorization\Model\ResourceModel\Rules\Collection $resourceCollection,
  39. array $data = []
  40. ) {
  41. parent::__construct($context, $registry, $resource, $resourceCollection, $data);
  42. }
  43. /**
  44. * Class constructor
  45. *
  46. * @return void
  47. */
  48. protected function _construct()
  49. {
  50. $this->_init(\Magento\Authorization\Model\ResourceModel\Rules::class);
  51. }
  52. /**
  53. * @return $this
  54. */
  55. public function update()
  56. {
  57. $this->getResource()->update($this);
  58. return $this;
  59. }
  60. /**
  61. * @return $this
  62. */
  63. public function saveRel()
  64. {
  65. $this->getResource()->saveRel($this);
  66. return $this;
  67. }
  68. }