<?php

declare(strict_types=1);

namespace {{ tree.getFullNameSpaceOfFile(file, entity, action) }};

{% for dependency in dependencyzz %}
use {{ dependency }};{% endfor %}
use Illuminate\Database\Eloquent\Collection;

class {{ helper.getClassName(file, entity, action) }}
{
    /**
     * @return Collection<int, {{ helper.getClassName(helper.findFile('Model'), entity, action) }}>
     */
    public function run(
        int $UserId,
{% for column in columnzz %}
        {{ helper.makeColumnType(column) }} ${{ column.alias }},{% endfor %}
    ): Collection
    {
        $qb = {{ helper.getClassName(helper.findFile('Model'), entity, action) }}::query();
        $qb->where('UserId', $UserId);

{% for column in columnzz %}
        $qb->where('{{ column.alias }}', ${{ column.alias }});{% endfor %}

        return $qb->get();
    }

}
