Properties

$ParamsFetcher

$ParamsFetcher : 

Request params fetcher.

Type

$Model

$Model : 

Model.

Type

$FieldsAlgorithms

$FieldsAlgorithms : 

Fields algorithms.

Type

$FormBuilder

$FormBuilder : 

Form builder.

Type

$EntityName

$EntityName : 

Entity name.

Type

$ListBuilder

$ListBuilder : 

List builder.

Type

Methods

connect()

connect() : array

Method creates connection.

Returns

array —

session id.

set_token()

set_token() : array

Method sets token.

Returns

array —

Session id.

get_self_id()

get_self_id() : integer

Method returns session user's id.

Returns

integer —

Session user's id.

get_self_login()

get_self_login() : string

Method returns session user's login.

Returns

string —

Session user's login.

login_as()

login_as() : array

Method allows to login under another user.

Returns

array —

Session id.

get_self_id_value()

get_self_id_value() : integer

Method returns self id.

Returns

integer —

Session user's id.

get_self_login_value()

get_self_login_value() : string

Method returns self login.

Returns

string —

Session user's login.

__construct()

__construct(object  $ParamsFetcher, object  $SecurityProvider, mixed  $Model = null) 

Constructor.

Parameters

object $ParamsFetcher
  • Params fetcher.
object $SecurityProvider
  • Security provider.
mixed $Model
  • Service model.

init_service_logic_fields()

init_service_logic_fields(\string  $TableName, \string  $EntityName, array  $Layout, array  $Fields) 

Parameters

\string $TableName
\string $EntityName
array $Layout
array $Fields

get_by_id()

get_by_id(integer  $id, integer  $DomainId = false, object  $FieldCompiler = false) : object

Method returns record by id.

Parameters

integer $id
  • id of the fetching record;
integer $DomainId
  • domain id;
object $FieldCompiler
  • field compilator.

Returns

object —
  • Fetched record.

get_by_ids()

get_by_ids(integer  $ids, integer  $DomainId = false, callback  $FieldCompiler = false) : array

Method returns records by ids.

Parameters

integer $ids
  • ids;
integer $DomainId
  • domain;
callback $FieldCompiler
  • list compiler.

Returns

array —

List of records.

delete_record()

delete_record() : integer

Method deletes the specified record.

Returns

integer —

id of the deleted record.

delete_filtered()

delete_filtered() 

Method deletes filtered records.

list_page_simple()

list_page_simple() : array<mixed,string>|array<mixed,NULL>

Method returns cimpiled simple list of recorsds.

Returns

array<mixed,string>|array<mixed,NULL> —
  • compiled list of records.

list_page()

list_page() : array<mixed,string>|array<mixed,NULL>

Method returns cimpiled list of recorsds.

Returns

array<mixed,string>|array<mixed,NULL> —
  • compiled list of records.

get_records()

get_records(integer  $DomainId, array  $Order, array  $FieldCompiler, integer  $From, integer  $Limit) : array

Method returns records.

Parameters

integer $DomainId
  • Domain id.
array $Order
  • Sorting settings.
array $FieldCompiler
  • Fields compilator.
integer $From
  • Starting record.
integer $Limit
  • Fetch limit.

Returns

array —

of records after all transformations.

get_domain_id()

get_domain_id() : integer

Method returns domain id.

Returns

integer —

Domain id.

add_title()

add_title(array  $Record) : array

Method compiles title field if necessary.

Parameters

array $Record
  • record to be extended with 'title' field.

Returns

array —

with 'title' field.

add_compiled_fields()

add_compiled_fields(array  $Record) : array

Method adds compiled fields.

Parameters

array $Record
  • record to be extended with compiled fields.

Returns

array —

with transformed record.

preprocess_list_item()

preprocess_list_item(  $Record) 

Preprocessing record.

Parameters

$Record

list_record()

list_record() : array

Method returns records.

Returns

array —

of records after all transformations.

all()

all() : array

Method returns all records.

Returns

array —

of records after all transformations.

get_fields()

get_fields() : array

Method returns fields.

Returns

array —

List of fields.

new_records_since()

new_records_since() : array

Method returns all records created since $Date.

Returns

array —

List of records created since $Date.

records_count()

records_count() : integer

Method returns records count.

Returns

integer —

Records count.

last_records()

last_records(  $Count) : array

Method returns last $Count records.

Parameters

$Count

Returns

array —

List of the last $Count records.

update_basic_fields()

update_basic_fields(integer  $id,   $DomainId) : array

Method compiles basic update record.

Parameters

integer $id
  • id of the updating record.
$DomainId

Returns

array —

with updated fields.

update_custom_fields()

update_custom_fields(integer  $id, array|object  $Record, array  $CustomFields) : array|object

Method updates custom fields.

Parameters

integer $id
  • Id of the updating record.
array|object $Record
  • Updating data.
array $CustomFields
  • Custom fields to be updated.

Returns

array|object —
  • Updated data.

update_record()

update_record() : array

Method updates record and it's custom fields.

Returns

array —

Updated fields and their new values.

insert_basic_fields()

insert_basic_fields() : array

Method inserts basic fields.

Returns

array —

Inserted record.

insert_custom_fields()

insert_custom_fields(array  $Record) : array

Method inserts custom fields.

Parameters

array $Record
  • Already inserted fields.

Returns

array —

Inserted record.

insert_external_fields()

insert_external_fields(array  $Record, string  $EntityName, string  $SessionId) : array

Method inserts external fields.

Parameters

array $Record
  • Already inserted fields.
string $EntityName
  • Name of the entity.
string $SessionId
  • Session id.

Returns

array —

Inserted record.

insert_records_fields()

insert_records_fields(  $MaterRecord) : array

Method inserts records fields.

Parameters

$MaterRecord

Returns

array —

Inserted record.

create_record()

create_record() : array

Method creates user.

Returns

array —

Created record.

update_page()

update_page() : array

Update page compilator.

Returns

array —

Compiled update form.

create_page()

create_page(string  $SessionId) : array<mixed,string>

Method compiles create page form.

Parameters

string $SessionId
  • Session id.

Returns

array<mixed,string> —

Compiled creation form.

create_page_form_fields()

create_page_form_fields(string  $SessionId) : array

Metehod returns list of fields for creation form.

Parameters

string $SessionId

Returns

array —

Creationform's fields.

increment_views()

increment_views() : integer

Method increments amount of views.

Returns

integer —

id of the updated record.

exact()

exact() : array

Method returns exact record from the table.

Returns

array —

Exact record.

exact_list()

exact_list() : array

Method returns exact records from the table.

Returns

array —

Exact list of records.

records_count_by_field()

records_count_by_field() : integer

Method returns records count, grouped by the specified field.

Returns

integer —

Records count.

create_page_form_fields_json()

create_page_form_fields_json() : array

Fields descriptions.

Returns

array —

Fields descriptions.

has_permit()

has_permit(string  $Permit) : boolean

Checking does user has permit.

Parameters

string $Permit
  • Permit to check.

Returns

boolean —

true or false if the session user has permit or not.

validate_permit()

validate_permit(string  $Permit) 

The same as has_permit but throwing exception for session user no permit.

Parameters

string $Permit
  • Permit name.

get_param()

get_param(string  $Param, mixed  $Default = false) : mixed

Method returns request parameter.

Parameters

string $Param
  • parameter name.
mixed $Default
  • default value.

Returns

mixed —

Parameter value.

result()

result(mixed  $Value) : array

Method compiles result structure to be returned by endpoint.

Parameters

mixed $Value
  • Value to be returned.

Returns

array

compile_page()

compile_page(string  $Main, string  $Title) : array

Method compiles return values.

Parameters

string $Main
  • Page's main content.
string $Title
  • Page's title.

Returns

array —
  • Page parts.

get_field_compiler()

get_field_compiler() : array

Method returns field compiler.

Returns

array

is_bot()

is_bot(string  $UserAgent) : boolean

Method returns true if any bot was detected.

Parameters

string $UserAgent
  • Visitor's user agent.

Returns

boolean —

True|false.

fetch_sub_records()

fetch_sub_records(array  $MasterRecord, array  $Field) : array

Method returns all inputed records for field $Field.

Parameters

array $MasterRecord
  • Master-record.
array $Field
  • Field description.

Returns

array —

Array of sub-records.

add_prefix_to_fields()

add_prefix_to_fields(array  $Record, string  $Prefix) : string

Method adds prefiex to fields names.

Parameters

array $Record
  • Inserting record.
string $Prefix
  • Field names prefix.

Returns

string —

Inserted record.