Skip to content

Remove not needed statements that are also stored in SqlStatementRepository #20

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

Closed
wants to merge 1 commit into from

Conversation

sippsolutions
Copy link
Member

Remove not needed statements that are also stored in SqlStatementRepository

@sippsolutions
Copy link
Member Author

@wagnert

Copy link
Member

@wagnert wagnert left a comment

Choose a reason for hiding this comment

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

Beside the comments in the code, it would be nice, if you can also delete the appropriate constants in the class, if not needed anymore.

is_autogenerated = :is_autogenerated,
metadata = :metadata
WHERE url_rewrite_id = :url_rewrite_id',
SqlStatementKeys::CREATE_URL_REWRITE_PRODUCT_CATEGORY =>
Copy link
Member

Choose a reason for hiding this comment

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

This is not available in 'TechDivision\Import\Utils\SqlStatements' and can therefor not been deleted.

VALUES (:url_rewrite_id,
:category_id,
:product_id)',
SqlStatementKeys::UPDATE_URL_REWRITE_PRODUCT_CATEGORY =>
Copy link
Member

Choose a reason for hiding this comment

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

This is not available in 'TechDivision\Import\Utils\SqlStatements' and can therefor not been deleted.

SET category_id = :category_id,
product_id = :product_id
WHERE url_rewrite_id = :url_rewrite_id',
SqlStatementKeys::DELETE_URL_REWRITE_PRODUCT_CATEGORY =>
Copy link
Member

Choose a reason for hiding this comment

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

This is not available in 'TechDivision\Import\Utils\SqlStatements' and can therefor not been deleted.

'DELETE
FROM catalog_url_rewrite_product_category
WHERE url_rewrite_id = :url_rewrite_id',
SqlStatementKeys::URL_REWRITE_PRODUCT_CATEGORY =>
Copy link
Member

Choose a reason for hiding this comment

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

This is not available in 'TechDivision\Import\Utils\SqlStatements' and can therefor not been deleted.

'SELECT *
FROM catalog_url_rewrite_product_category
WHERE url_rewrite_id = :url_rewrite_id',
SqlStatementKeys::URL_REWRITES_BY_SKU =>
Copy link
Member

Choose a reason for hiding this comment

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

This is not available in 'TechDivision\Import\Utils\SqlStatements' and can therefor not been deleted.

WHERE t1.sku = :sku
AND t2.entity_id = t1.entity_id
AND t2.entity_type = \'product\'',
SqlStatementKeys::URL_REWRITE_PRODUCT_CATEGORIES_BY_SKU =>
Copy link
Member

Choose a reason for hiding this comment

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

This is not available in 'TechDivision\Import\Utils\SqlStatements' and can therefor not been deleted.

@wagnert wagnert self-assigned this Mar 12, 2020
@sippsolutions
Copy link
Member Author

Hi @wagnert,

the deleted code seems to be copied from the SqlStatementRepository class.
The constructor tries to assign data to a variable called "preparedStatements" that's not available in SqlStatementKeys classes, but is available in Repositories.
Are you sure the mentioned keys are still needed?
If they are needed, a $preparedStatements private variable should be declared, otherwise the code should be removed (and the constants you mentioned aswell).

@wagnert
Copy link
Member

wagnert commented Mar 13, 2020

Will be fixed with the next release.

@wagnert wagnert closed this Mar 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants