alpha2 (#2)
- Change multiple field matching to enum - Implement auto-generated IDs Reviewed-on: #2
This commit was merged in pull request #2.
This commit is contained in:
@@ -27,14 +27,14 @@ class Patch
|
||||
* @param string $tableName The table in which documents should be patched
|
||||
* @param array|Field[] $fields The field comparison to match
|
||||
* @param array|object $patch The object with which the documents should be patched (will be JSON-encoded)
|
||||
* @param string $conjunction How to handle multiple conditions (optional; defaults to `AND`)
|
||||
* @param FieldMatch|null $match How to handle multiple conditions (optional; defaults to All)
|
||||
* @throws DocumentException If any is encountered
|
||||
*/
|
||||
public static function byFields(string $tableName, array $fields, array|object $patch,
|
||||
string $conjunction = 'AND'): void
|
||||
?FieldMatch $match = null): void
|
||||
{
|
||||
$namedFields = Parameters::nameFields($fields);
|
||||
Custom::nonQuery(Query\Patch::byFields($tableName, $namedFields, $conjunction),
|
||||
Custom::nonQuery(Query\Patch::byFields($tableName, $namedFields, $match),
|
||||
Parameters::addFields($namedFields, Parameters::json(':data', $patch)));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user