Pull all assets from a specific volume subfolder id Is there a way to pull all assets from a volume subfolder id?

{% set entries = craft.entries.section('pages').type('genealogy').search('pageType:stake') %}
{% for entry in entries.all() %}
    {% if entry.id == x %}
        get all assets from volume subfolder a
    {% elseif entry.id == y %}
        get all assets from volume subfolder b
    {% endif %}
{% endfor %}
Twig

{% set assets = craft.assets.volumeId(y).folderId(x).all() %}


PHP

$assets = Asset::find()-&gt;volumeId(y)-&gt;folderId(x)-&gt;all();