Skip to content

Conversation

@naydav
Copy link

@naydav naydav commented Sep 4, 2017

@magento-cicd2
Copy link

magento-cicd2 commented Sep 4, 2017

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.

class Source extends AbstractDb
{
/**
* Provide possibility of save entity with predefined id
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

of saving

use Magento\Framework\Model\AbstractModel;

/**
* Provide possibility of save entity with predefined id
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Provides ... of saving predefined/pre-generated


/**
* Provide possibility of save entity with predefined id
* Use trait instead of extending for better reusability, also we don'nt want to hardcode hierarchy of inheritance
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The choice to use trait instead of inheritance was made to prevent the introduction of new layer super type on the module basis as well as better code reusability, as potentially current trait not coupled to Inventory module and other modules could re-use this approach.

trait PredefinedId
{
/**
* Check if object is new
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overwrite default AbstractModel implementation of the function isObjectNew
@see origina

adding the possibility to check whether (record) already exists in DataBase or not

class Stock extends AbstractDb
{
/**
* Provide possibility of save entity with predefined id
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Provides

@naydav naydav merged commit 6b63878 into develop Sep 4, 2017
@maghamed maghamed deleted the predefined-id branch March 20, 2019 15:08
sidolov pushed a commit that referenced this pull request May 11, 2021
MC-40568: Stabilize MFTF tests (Inventory)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants