static function getMap()
{
return array(
'ID' => new MainEntityIntegerField('ID', array(
'primary' => true,
'autocomplete' => true,
'title' => Loc::getMessage('DISCOUNT_ENTITY_ID_FIELD')
)),
'XML_ID' => new MainEntityStringField('XML_ID', array(
'validation' => array(__CLASS__, 'validateXmlId'),
'title' => Loc::getMessage('DISCOUNT_ENTITY_XML_ID_FIELD')
)),
'LID' => new MainEntityStringField('LID', array(
'required' => true,
'validation' => array(__CLASS__, 'validateLid'),
'title' => Loc::getMessage('DISCOUNT_ENTITY_LID_FIELD')
)),
'NAME' => new MainEntityStringField('NAME', array(
'validation' => array(__CLASS__, 'validateName'),
'title' => Loc::getMessage('DISCOUNT_ENTITY_NAME_FIELD')
)),
'PRICE_FROM' => new MainEntityFloatField('PRICE_FROM', array()),
'PRICE_TO' => new MainEntityFloatField('PRICE_TO', array()),
'CURRENCY' => new MainEntityStringField('CURRENCY', array(
'validation' => array(__CLASS__, 'validateCurrency'),
'title' => Loc::getMessage('DISCOUNT_ENTITY_CURRENCY_FIELD')
)),
'DISCOUNT_VALUE' => new MainEntityFloatField('DISCOUNT_VALUE', array()),
'DISCOUNT_TYPE' => new MainEntityStringField('DISCOUNT_TYPE', array(
'default_value' => 'P',
'validation' => array(__CLASS__, 'validateDiscountType')
)),
'ACTIVE' => new MainEntityBooleanField('ACTIVE', array(
'values' => array('N', 'Y'),
'default_value' => 'Y',
'title' => Loc::getMessage('DISCOUNT_ENTITY_ACTIVE_FIELD')
)),
'SORT' => new MainEntityIntegerField('SORT', array(
'title' => Loc::getMessage('DISCOUNT_ENTITY_SORT_FIELD')
)),
'ACTIVE_FROM' => new MainEntityDatetimeField('ACTIVE_FROM', array(
'default_value' => null,
'title' => Loc::getMessage('DISCOUNT_ENTITY_ACTIVE_FROM_FIELD')
)),
'ACTIVE_TO' => new MainEntityDatetimeField('ACTIVE_TO', array(
'default_value' => null,
'title' => Loc::getMessage('DISCOUNT_ENTITY_ACTIVE_TO_FIELD')
)),
'TIMESTAMP_X' => new MainEntityDatetimeField('TIMESTAMP_X', array(
'default_value' => function(){ return new MainTypeDateTime(); },
'title' => Loc::getMessage('DISCOUNT_ENTITY_TIMESTAMP_X_FIELD')
)),
'MODIFIED_BY' => new MainEntityIntegerField('MODIFIED_BY', array(
'default_value' => null,
'title' => Loc::getMessage('DISCOUNT_ENTITY_MODIFIED_BY_FIELD')
)),
'DATE_CREATE' => new MainEntityDatetimeField('DATE_CREATE', array(
'default_value' => function(){ return new MainTypeDateTime(); },
'title' => Loc::getMessage('DISCOUNT_ENTITY_DATE_CREATE_FIELD')
)),
'CREATED_BY' => new MainEntityIntegerField('CREATED_BY', array(
'default_value' => null,
'title' => Loc::getMessage('DISCOUNT_ENTITY_CREATED_BY_FIELD')
)),
'PRIORITY' => new MainEntityIntegerField('PRIORITY', array(
'default_value' => 1,
'title' => Loc::getMessage('DISCOUNT_ENTITY_PRIORITY_FIELD')
)),
'LAST_DISCOUNT' => new MainEntityBooleanField('LAST_DISCOUNT', array(
'values' => array('N', 'Y'),
'default_value' => 'Y',
'title' => Loc::getMessage('DISCOUNT_ENTITY_LAST_DISCOUNT_FIELD')
)),
'LAST_LEVEL_DISCOUNT' => new MainEntityBooleanField('LAST_LEVEL_DISCOUNT', array(
'values' => array('N', 'Y'),
'default_value' => 'N',
)),
'VERSION' => new MainEntityEnumField('VERSION', array(
'values' => array(self::VERSION_OLD, self::VERSION_NEW, self::VERSION_15),
'default_value' => self::VERSION_15,
'title' => Loc::getMessage('DISCOUNT_ENTITY_VERSION_FIELD')
)),
'CONDITIONS_LIST' => new MainEntityTextField('CONDITIONS_LIST', array(
'serialized' => true,
'column_name' => 'CONDITIONS',
'title' => Loc::getMessage('DISCOUNT_ENTITY_CONDITIONS_LIST_FIELD')
)),
'CONDITIONS' => new MainEntityExpressionField('CONDITIONS', '%s', 'CONDITIONS_LIST'),
'UNPACK' => new MainEntityTextField('UNPACK', array()),
'ACTIONS_LIST' => new MainEntityTextField('ACTIONS_LIST', array(
'serialized' => true,
'column_name' => 'ACTIONS',
'title' => Loc::getMessage('DISCOUNT_ENTITY_ACTIONS_LIST_FIELD')
)),
'ACTIONS' => new MainEntityExpressionField('ACTIONS', '%s', 'ACTIONS_LIST'),
'APPLICATION' => new MainEntityTextField('APPLICATION', array()),
'PREDICTION_TEXT' => new MainEntityTextField('PREDICTION_TEXT', array()),
'PREDICTIONS_APP' => new MainEntityTextField('PREDICTIONS_APP', array()),
'PREDICTIONS_LIST' => new MainEntityTextField('PREDICTIONS_LIST', array(
'serialized' => true,
'column_name' => 'PREDICTIONS',
)),
'PREDICTIONS' => new MainEntityExpressionField('PREDICTIONS', '%s', 'PREDICTIONS_LIST'),
'USE_COUPONS' => new MainEntityBooleanField('USE_COUPONS', array(
'values' => array('N', 'Y'),
'default_value' => 'N',
'title' => Loc::getMessage('DISCOUNT_ENTITY_USE_COUPONS_FIELD')
)),
'EXECUTE_MODULE' => new MainEntityStringField('EXECUTE_MODULE', array(
'validation' => array(__CLASS__, 'validateExecuteModule'),
'title' => Loc::getMessage('DISCOUNT_ENTITY_EXECUTE_MODULE_FIELD')
)),
'EXECUTE_MODE' => new MainEntityIntegerField('EXECUTE_MODE', array(
'default_value' => self::EXECUTE_MODE_GENERAL,
)),
'HAS_INDEX' => new MainEntityBooleanField('HAS_INDEX', array(
'values' => array('N', 'Y'),
'default_value' => 'N',
)),
'PRESET_ID' => new MainEntityStringField('PRESET_ID', array(
'validation' => array(__CLASS__, 'validatePresetId'),
)),
'SHORT_DESCRIPTION_STRUCTURE' => new MainEntityTextField('SHORT_DESCRIPTION_STRUCTURE', array(
'serialized' => true,
'column_name' => 'SHORT_DESCRIPTION',
)),
'SHORT_DESCRIPTION' => new MainEntityExpressionField('SHORT_DESCRIPTION', '%s', 'SHORT_DESCRIPTION_STRUCTURE'),
'CREATED_BY_USER' => new MainEntityReferenceField(
'CREATED_BY_USER',
'BitrixMainUser',
array('=this.CREATED_BY' => 'ref.ID'),
array('join_type' => 'LEFT')
),
'MODIFIED_BY_USER' => new MainEntityReferenceField(
'MODIFIED_BY_USER',
'BitrixMainUser',
array('=this.MODIFIED_BY' => 'ref.ID'),
array('join_type' => 'LEFT')
),
'COUPON' => new MainEntityReferenceField(
'COUPON',
'BitrixSaleInternalsDiscountCoupon',
array('=this.ID' => 'ref.DISCOUNT_ID'),
array('join_type' => 'LEFT')
),
'DISCOUNT_ENTITY' => new MainEntityReferenceField(
'DISCOUNT_ENTITY',
'BitrixSaleInternalsDiscountEntities',
array('=this.ID' => 'ref.DISCOUNT_ID'),
array('join_type' => 'LEFT')
)
);
}