Views: 3698 (Data available since 06.02.2017)
Unlike the Information Blocks module the module Highloadblock provides for the storage of each entity in its table. Entity fields are user-defined properties of the core. Entities are built in the administrative interface, i.e. without additional programming.
Since the module works on a new core, access to data will be given based on ORM.
Data may be allocated not only in the tables of the same database, but also in different databases. Thus, project scale out becomes possible when certain objects are located on one server and others on another.
NoSQL support is added to Highloadblock based on the MySQL database. Database connection is effected through the extension handlersocket for MySQL.
Let us assume that a project has NoSQL support configured, all the necessary MySQL drivers are installed, and kernel configuration provides for the connection through these drivers. As a result, the Highloadblock module permits you to create entities and build the project to access the database very quickly through the driver using a primary key.
In order to use an ORM entity for Highloadblock the following actions must be performed:
- Initialize an entity in the system:
//first select information about it from the database
$hldata = Bitrix\Highloadblock\HighloadBlockTable::getById($ID)->fetch();
//then initialize an entity class
$hlentity = Bitrix\Highloadblock\HighloadBlockTable::compileEntity($hldata);
- After that, queries may be created with this entity:
$query = new Entity\Query($hlentity);
Or use it through the interface of DataManager:
$hlDataClass = $hldata['NAME'].'Table';
All further work with Highloadblock is subject to ORM laws, because the entity created in Highloadblock is an ORM entity.
The module comprises two components – the list of entity entries (highloadblock.list) and a detailed view of an entity (highloadblock.view).