403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/lpost.delivery/lib/entity/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/lpost.delivery/lib/entity/trackingtable.php
<?

namespace Lpost\Delivery\Entity;

use Bitrix\Main\Localization\Loc,
    Bitrix\Main\ORM\Data\DataManager,
    Bitrix\Main\ORM\Fields\DatetimeField,
    Bitrix\Main\ORM\Fields\IntegerField,
    Bitrix\Main\ORM\Fields\StringField,
    Bitrix\Main\ORM\Fields\TextField,
    Bitrix\Main\ORM\Fields\Validators\LengthValidator,
    Bitrix\Main\Type\DateTime;

Loc::loadMessages(__FILE__);

/**
 * Class TrackingTable
 *
 * Fields:
 * <ul>
 * <li> id int mandatory
 * <li> id_order int mandatory
 * <li> id_order_lpost string(20) mandatory
 * <li> state_order string(2) optional default 'D'
 * <li> state string(50) mandatory
 * <li> params text optional
 * <li> date_change datetime optional default current datetime
 * <li> date_request datetime optional default current datetime
 * </ul>
 *
 * @package Bitrix\Delivery
 **/
class TrackingTable extends DataManager
{
    /**
     * Returns DB table name for entity.
     *
     * @return string
     */
    public static function getTableName() {
        return 'lpost_delivery_tracking';
    }

    /**
     * Returns entity map definition.
     *
     * @return array
     */
    public static function getMap() {
        return [
            new IntegerField(
                'id',
                [
                    'primary' => true,
                    'autocomplete' => true,
                    'title' => Loc::getMessage('TRACKING_ENTITY_ID_FIELD')
                ]
            ),
            new IntegerField(
                'id_order',
                [
                    'required' => true,
                    'title' => Loc::getMessage('TRACKING_ENTITY_ID_ORDER_FIELD')
                ]
            ),
            new StringField(
                'id_order_lpost',
                [
                    'required' => true,
                    'validation' => [__CLASS__, 'validateIdOrderLpost'],
                    'title' => Loc::getMessage('TRACKING_ENTITY_ID_ORDER_LPOST_FIELD')
                ]
            ),
            new StringField(
                'state_order',
                [
                    'default' => 'D',
                    'validation' => [__CLASS__, 'validateStateOrder'],
                    'title' => Loc::getMessage('TRACKING_ENTITY_STATE_ORDER_FIELD')
                ]
            ),
            new StringField(
                'state',
                [
                    'required' => true,
                    'validation' => [__CLASS__, 'validateState'],
                    'title' => Loc::getMessage('TRACKING_ENTITY_STATE_FIELD')
                ]
            ),
            new TextField(
                'params',
                [
                    'title' => Loc::getMessage('TRACKING_ENTITY_PARAMS_FIELD')
                ]
            ),
            new DatetimeField(
                'date_change',
                [
                    'default' => function () {
                        return new DateTime();
                    },
                    'title' => Loc::getMessage('TRACKING_ENTITY_DATE_CHANGE_FIELD')
                ]
            ),
            new DatetimeField(
                'date_request',
                [
                    'default' => function () {
                        return new DateTime();
                    },
                    'title' => Loc::getMessage('TRACKING_ENTITY_DATE_REQUEST_FIELD')
                ]
            ),
        ];
    }

    /**
     * Returns validators for id_order_lpost field.
     *
     * @return array
     */
    public static function validateIdOrderLpost() {
        return [
            new LengthValidator(null, 20),
        ];
    }

    /**
     * Returns validators for state_order field.
     *
     * @return array
     */
    public static function validateStateOrder() {
        return [
            new LengthValidator(null, 2),
        ];
    }

    /**
     * Returns validators for state field.
     *
     * @return array
     */
    public static function validateState() {
        return [
            new LengthValidator(null, 50),
        ];
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit