Skip to content

Commit

Permalink
Merge pull request #7863 in SW/shopware from ntr/5.6/add-deprecation-…
Browse files Browse the repository at this point in the history
…notice to 5.6

* commit '143ff9ac005e0ad2952ad901e240397dc1df8dce':
  NTR - Add deprecation notice for `\Shopware\Bundle\StoreFrontBundle\Gateway\DBAL\CategoryGateway::get` with an array of ids
  • Loading branch information
shyim committed Jul 8, 2019
2 parents d7f2db9 + 143ff9a commit 406925f
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,14 @@ public function __construct(
public function get($id, Struct\ShopContextInterface $context)
{
/*
* @deprecated since 5.5, will be removed in Shopware 5.6
* @deprecated since 5.5, will be removed in Shopware 5.7
*
* Allowing an array as a parameter is supported in 5.5.x for legacy reasons.
* The check below will be removed in Shopware 5.6
* Allowing an array as a parameter is supported in 5.5/5.6 for legacy reasons.
* The check below will be removed in Shopware 5.7
*/
if (is_array($id)) {
trigger_error(sprintf('Calling %s:%s with an array of Ids is deprecated since Shopware 5.5 and will crash with 5.7. Use a single int Id instead.', __CLASS__, __METHOD__), E_USER_DEPRECATED);

$id = $id[0];
}
$categories = $this->getList([$id], $context);
Expand Down

0 comments on commit 406925f

Please sign in to comment.