Method | Description | |
---|---|---|
compareData ( $entities, array $requestEntities, callable $compare = null, callable $add = null, callable $update = null, callable $delete = null ) : boolean | function compares entities with data of array and makes callback. | |
compareEntitiesWithData ( Traversable $entities, array $requestEntities, callable $compare, callable $add = null, callable $update = null, callable $delete = null ) : boolean | Compares entities with data array and calls the given callbacks. | |
processSubEntities ( Traversable $entities, array $requestEntities, callable $get, callable $add = null, callable $update = null, callable $delete = null ) : boolean | This method processes a put request (delete non-existing entities, update existing entities, add new entries), and let the single actions be modified by callbacks. |
Method | Description | |
---|---|---|
findMatchByCallback ( $entity, array $requestEntities, callable $compare, array &$matchedEntry, string &$matchedKey ) | Applies a given compare function to a given set of data entries. Returns the entity itself and its key with the $matchedEntry and $matchKey parameters. |
public compareEntitiesWithData ( Traversable $entities, array $requestEntities, callable $compare, callable $add = null, callable $update = null, callable $delete = null ) : boolean | ||
$entities | Traversable | The list of entities to work on |
$requestEntities | array | The entities as retrieved from the request |
$compare | callable | return true if data matches entity |
$add | callable | |
$update | callable | |
$delete | callable | |
return | boolean |
protected findMatchByCallback ( $entity, array $requestEntities, callable $compare, array &$matchedEntry, string &$matchedKey ) | ||
$entity | The entity to compare | |
$requestEntities | array | The set of entities to search in |
$compare | callable | Compare function, which defines if data matches the entity |
$matchedEntry | array | |
$matchedKey | string |
public processSubEntities ( Traversable $entities, array $requestEntities, callable $get, callable $add = null, callable $update = null, callable $delete = null ) : boolean | ||
$entities | Traversable | The list of entities to work on |
$requestEntities | array | The entities as retrieved from the request |
$get | callable | Return id of entity |
$add | callable | |
$update | callable | |
$delete | callable | |
return | boolean |