In Twig, we can do this like this:
craft.entries({
id: 11,
relatedTo: 22,
})
But in PHP code, this does not work:
\craft\elements\Entry::find(
[
'id' => 11,
'relatedTo' => 22,
],
)
I think that only way would be loop through array and apply to initial query object each array position as element query method. Or maybe am I wrong?
I checked Craft source code and in file base/Element.php
, in method find()
there is no param to pass array of element query methods into.