Skip to content

Refactoring magento sales sequence #19930

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions app/code/Magento/SalesRule/Model/Coupon.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ protected function _construct()
/**
* Set rule instance
*
* @param \Magento\SalesRule\Model\Rule $rule
* @param Rule $rule
* @return $this
*/
public function setRule(\Magento\SalesRule\Model\Rule $rule)
public function setRule(Rule $rule)
{
$this->setRuleId($rule->getId());
return $this;
Expand All @@ -51,7 +51,7 @@ public function setRule(\Magento\SalesRule\Model\Rule $rule)
/**
* Load primary coupon for specified rule
*
* @param \Magento\SalesRule\Model\Rule|int $rule
* @param Rule|int $rule
* @return $this
*/
public function loadPrimaryByRule($rule)
Expand Down
2 changes: 2 additions & 0 deletions app/code/Magento/SalesSequence/Model/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ public function __construct(
*
* @param string $entityType
* @param int $storeId
*
* @return \Magento\Framework\DB\Sequence\SequenceInterface
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function getSequence($entityType, $storeId)
{
Expand Down
11 changes: 9 additions & 2 deletions app/code/Magento/SalesSequence/Model/ResourceModel/Meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ public function loadByEntityTypeAndStore($entityType, $storeId)
* Using for load sequence profile and setting it into metadata
*
* @param \Magento\Framework\Model\AbstractModel $object
* @return $this
*
* @return $this|\Magento\Framework\Model\ResourceModel\Db\AbstractDb
* @throws \Magento\Framework\Exception\LocalizedException
*/
protected function _afterLoad(\Magento\Framework\Model\AbstractModel $object)
{
Expand Down Expand Up @@ -137,7 +139,12 @@ protected function _beforeSave(\Magento\Framework\Model\AbstractModel $object)
}

/**
* @inheritdoc
* Perform actions after object save
*
* @param \Magento\Framework\Model\AbstractModel $object
*
* @return $this|\Magento\Framework\Model\ResourceModel\Db\AbstractDb
* @throws \Magento\Framework\Exception\AlreadyExistsException
*/
protected function _afterSave(\Magento\Framework\Model\AbstractModel $object)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/
namespace Magento\SalesSequence\Model\ResourceModel;

use Magento\SalesSequence\Model\Meta as ModelMeta;
use Magento\Framework\Model\ResourceModel\Db\Context as DatabaseContext;
use Magento\SalesSequence\Model\ProfileFactory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,12 @@ public function __construct(
}

/**
* Observer triggered during adding new store
*
* @param EventObserver $observer
* @return $this
*
* @return $this|void
* @throws \Magento\Framework\Exception\AlreadyExistsException
*/
public function execute(EventObserver $observer)
{
Expand Down
2 changes: 2 additions & 0 deletions app/code/Magento/SalesSequence/Setup/SequenceCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ public function __construct(

/**
* Creates sales sequences.
*
* @throws \Magento\Framework\Exception\AlreadyExistsException
*/
public function create()
{
Expand Down