In ESPO 6.1.0 and below I had this code under the actionList() controller method, which would replace the phoneNumber search attribute with phoneNumberNumeric attribute such that the ORM would query with just the numbers in the DB and find the entities.
But since 7.0 I can no longer do this as fetchListParamsFromRequest method no longer exists.
How do I go about searching for entities (from list view search filters) with just the numeric phone number values?
telecastg item Any clue?
Code:
if ($params['where'] != null) { $whereCount = 0; foreach ($params['where'] as $where) { if (isset($where['attribute'])) { if ($where['attribute'] == 'phoneNumber') { $newWhere = [ 'attribute' => 'phoneNumberNumeric', 'type' => $where['type'], 'value' => preg_replace('/[^0-9]/', '', $where['value']), ]; $params['where'][$whereCount] = $newWhere; } ++$whereCount; } } }
How do I go about searching for entities (from list view search filters) with just the numeric phone number values?
telecastg item Any clue?
Comment