# Proxy method generated gives an warning when try to hook Repository method

**URL:** <https://forum.shopware.com/t/proxy-method-generated-gives-an-warning-when-try-to-hook-repository-method/44759>\
**Category:** International (English Only)\
**Tags:** programming\
**Created:** [23. März 2017 um 17:32 UTC](https://forum.shopware.com/t/proxy-method-generated-gives-an-warning-when-try-to-hook-repository-method/44759 "2017-03-23T17:32:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cboita](https://avatars.discourse-cdn.com/v4/letter/c/eb9ed0/32.png) [@cboita](https://forum.shopware.com/u/cboita)\
**Post date:** [23. März 2017 um 17:32 UTC](https://forum.shopware.com/t/proxy-method-generated-gives-an-warning-when-try-to-hook-repository-method/44759/1 "2017-03-23T17:32:25Z")

</div>

Hi everyone,

I need to add more logic to my&nbsp;\Shopware\Models\Blog\Repository::getBackendListQueryBuilder and for that I need to hook this repository.

I have my approach working fine but I get a console&nbsp;warning always I try to execute&nbsp;Shopware()-\>Models()-\>getRepository(‘Shopware\Models\Blog\Blog’)

Warning

PHP Warning: &nbsp;Declaration of Shopware\_Proxies\_ShopwareModelsBlogRepositoryProxy::getBackendListQueryBuilder($blogCategoryIds, $filter, $order) should be compatible with Shopware\Models\Blog\Repository::getBackendListQueryBuilder($blogCategoryIds, array $filter, $order) in /var/www/releases/20170306103132Z/var/cache/production\_201610051330/proxies/ShopwareModelsBlogRepositoryProxy.php on line 2

If I check ShopwareModelsBlogRepositoryProxy.php I have:

```
 public function getBackendListQueryBuilder($blogCategoryIds, $filter, $order)
    {
        return Shopware()->Hooks()->executeHooks(
            $this, 'getBackendListQueryBuilder', array('blogCategoryIds'=>$blogCategoryIds, 'filter'=>$filter, 'order'=>$order)
        );
    }

```

&nbsp;

And our repository class engine/Shopware/Models/Blog/Repository.php:318

```
public function getBackendListQueryBuilder($blogCategoryIds, array $filter, $order)
    {
        $builder = $this->getEntityManager()->createQueryBuilder();
        $builder->select(
            array(
                'blog.id',
[...]

```

As you see $filter argument as type array on Repository Class and that isn’t present on Proxy Class, that’s why we get the warning.  
If we try to remove ‘array’ the warning is out.

This means the generation of the proxy doesn’t have in account the type of argument.

What can I do to avoid this warning or&nbsp;should we open an issue for this?

&nbsp;

Thanks.
