Current Path : /home/bitrix/ext_www/klimatlend.ua/local/lib/Epages/ |
Current File : /home/bitrix/ext_www/klimatlend.ua/local/lib/Epages/CustomIpropertyTable.php |
<?php namespace Epages; use Bitrix\Main; /** * Class IpropertyTable * * Fields: * <ul> * <li> ID int mandatory * <li> IBLOCK_ID int mandatory * <li> CODE string(50) mandatory * <li> ENTITY_TYPE string(1) mandatory * <li> ENTITY_ID int mandatory * <li> TEMPLATE string mandatory * </ul> * * @package Bitrix\Iblock **/ class CustomIpropertyTable extends Main\Entity\DataManager { /** * Returns DB table name for entity. * * @return string */ public static function getTableName() { return 'b_iblock_iproperty'; } /** * Returns entity map definition. * * @return array */ public static function getMap() { return array( 'ID' => array( 'data_type' => 'integer', 'primary' => true, 'autocomplete' => true, 'title' => 'ID', ), 'IBLOCK_ID' => array( 'data_type' => 'integer', 'required' => true, 'title' => 'IBLOCK_ID', ), 'CODE' => array( 'data_type' => 'string', 'required' => true, 'validation' => array(__CLASS__, 'validateCode'), 'title' => 'CODE', ), 'ENTITY_TYPE' => array( 'data_type' => 'string', 'required' => true, 'validation' => array(__CLASS__, 'validateEntityType'), 'title' => 'ENTITY_TYPE', ), 'ENTITY_ID' => array( 'data_type' => 'integer', 'required' => true, 'title' => 'ENTITY_ID', ), 'TEMPLATE' => array( 'data_type' => 'text', 'required' => true, 'title' => 'TEMPLATE', ), ); } /** * Returns validators for CODE field. * * @return array */ public static function validateCode() { return array( new Main\Entity\Validator\Length(null, 50), ); } /** * Returns validators for ENTITY_TYPE field. * * @return array */ public static function validateEntityType() { return array( new Main\Entity\Validator\Length(null, 1), ); } }