I want to do something very simple, have a collection that returns all customers that have a certain string in their name or email.
Based on how you can use in, I thought I would be able to do something like this
->addFieldToFilter(
array('email', 'firstname', 'lastname'),
array("like" => "%{$query}%")
)
However, I get an error
"Warning: Illegal string offset 'attribute' in vendor\magento\module-eav\Model\Entity\Collection\AbstractCollection.php on line 362"
The MySQL I am essentially aiming for is
SELECT * FROM mage_customer_entity
WHERE firstname LIKE '%tim%' OR email LIKE '%tim%';