CrudServiceClientInterface
in
Interface for basic Crud API client
Tags
Table of Contents
- create() : int
- Method creates new record
- delete() : string
- Method deletes record with $id
- deleteFiltered() : mixed
- Method deletes records by filter
- getById() : object
- Method returns record by it's id
- getByIdsArray() : array<string|int, mixed>
- Method returns records by their ids
- getFields() : array<string|int, mixed>
- Method returns fields and layout
- getList() : array<string|int, mixed>
- Method returns some records of the user's domain
- getRecordsBy() : array<string|int, mixed>
- Method returns all records by filter
- instance() : CrudServiceClient
- Method creates instance if the CrudServiceClient class
- lastRecords() : array<string|int, mixed>
- Method returns last $count records
- newRecordsSince() : array<string|int, mixed>
- Method returns all records created since $date
- recordsCount() : array<string|int, mixed>
- Method returns count of records
- recordsCountByField() : array<string|int, mixed>
- Method returns count off records
- update() : mixed
- Method updates new record
Methods
create()
Method creates new record
public
create(array<string|int, mixed> $data) : int
Parameters
- $data : array<string|int, mixed>
-
data for creating record
Return values
int —id of the created record
delete()
Method deletes record with $id
public
delete(int $id, int $crossDomain) : string
Parameters
- $id : int
-
Id of the deleting record
- $crossDomain : int
-
Break domain's bounds or not
Tags
Return values
string —Result of the deletion
deleteFiltered()
Method deletes records by filter
public
deleteFiltered(int $crossDomain[, array<string|int, mixed> $filter = false ]) : mixed
Parameters
- $crossDomain : int
-
Cross domain security settings
- $filter : array<string|int, mixed> = false
-
Filtering settings
Tags
Return values
mixed —getById()
Method returns record by it's id
public
getById(int $id, number $crossDomain) : object
Parameters
- $id : int
-
Id of the fetching record
- $crossDomain : number
-
Domain id
Tags
Return values
object —fetched record
getByIdsArray()
Method returns records by their ids
public
getByIdsArray(array<string|int, mixed> $ids, number $crossDomain) : array<string|int, mixed>
Parameters
- $ids : array<string|int, mixed>
-
List of ids
- $crossDomain : number
-
Domain id
Return values
array<string|int, mixed> —Fetched records
getFields()
Method returns fields and layout
public
getFields() : array<string|int, mixed>
Return values
array<string|int, mixed> —Fields and layout
getList()
Method returns some records of the user's domain
public
getList(int $from[, int $limit = 1000000000 ], int $crossDomain[, array<string|int, mixed> $filter = false ][, array<string|int, mixed> $order = false ]) : array<string|int, mixed>
Parameters
- $from : int
-
The beginnig of the fetching sequence
- $limit : int = 1000000000
-
Size of the fetching sequence
- $crossDomain : int
-
Cross domain security settings
- $filter : array<string|int, mixed> = false
-
Filtering settings
- $order : array<string|int, mixed> = false
-
Sorting settings
Return values
array<string|int, mixed> —List of records
getRecordsBy()
Method returns all records by filter
public
getRecordsBy(array<string|int, mixed> $filter, int $crossDomain) : array<string|int, mixed>
Parameters
- $filter : array<string|int, mixed>
-
Filtering settings
- $crossDomain : int
-
Cross domain security settings
Tags
Return values
array<string|int, mixed> —List of records
instance()
Method creates instance if the CrudServiceClient class
public
static instance(string $service, string $token) : CrudServiceClient
Parameters
- $service : string
-
Service to be connected to
- $token : string
-
Connection token
Return values
CrudServiceClient —Instance of the CrudServiceClient class
lastRecords()
Method returns last $count records
public
lastRecords(int $count, array<string|int, mixed> $filter) : array<string|int, mixed>
Parameters
- $count : int
-
Amount of records to be fetched
- $filter : array<string|int, mixed>
-
Filter data
Tags
Return values
array<string|int, mixed> —$count of last created records
newRecordsSince()
Method returns all records created since $date
public
newRecordsSince(datetime $date) : array<string|int, mixed>
Parameters
- $date : datetime
-
Start of the period
Tags
Return values
array<string|int, mixed> —List of records created since $date
recordsCount()
Method returns count of records
public
recordsCount() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —List of records created since $date
recordsCountByField()
Method returns count off records
public
recordsCountByField(string $field[, array<string|int, mixed> $filter = false ]) : array<string|int, mixed>
Parameters
- $field : string
-
Field for grouping
- $filter : array<string|int, mixed> = false
-
Filtering settings
Return values
array<string|int, mixed> —List of records created since $date
update()
Method updates new record
public
update(int $id, array<string|int, mixed> $data, int $crossDomain) : mixed
Parameters
- $id : int
-
Id of the updating record
- $data : array<string|int, mixed>
-
Data to be posted
- $crossDomain : int
-
Cross domain policy
Tags
Return values
mixed —Result of the RPC call