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/yandex.market/lib/watcher/agent/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/yandex.market/lib/watcher/agent/state.php
<?php
namespace Yandex\Market\Watcher\Agent;

use Bitrix\Main;
use Yandex\Market;

class StateTable extends Market\Reference\Storage\Table
{
	const VERSION = 2;

	public static function getTableName()
	{
		return 'yamarket_export_run_agent';
	}

	public static function getMap()
	{
		return [
			new Main\Entity\StringField('METHOD', [
				'required' => true,
				'primary' => true,
				'validation' => function() {
					return [
						new Main\Entity\Validator\Length(null, 15)
					];
				},
			]),
			new Main\Entity\EnumField('SETUP_TYPE', [
				'primary' => true,
				'required' => true,
				'values' => [
					Market\Glossary::SERVICE_EXPORT,
					Market\Glossary::SERVICE_SALES_BOOST,
					Market\Glossary::SERVICE_CATALOG,
				],
			]),
			new Main\Entity\IntegerField('SETUP_ID', [
				'primary' => true,
				'required' => true
			]),
			new Main\Entity\StringField('STEP', [
				'validation' => function() {
					return [
						new Main\Entity\Validator\Length(null, 50)
					];
				},
			]),
			new Main\Entity\StringField('OFFSET', [
				'validation' => function() {
					return [
						new Main\Entity\Validator\Length(null, 64)
					];
				},
			]),
			new Market\Reference\Storage\Field\CanonicalDateTime('START_TIME'),
			new Main\Entity\EnumField('VERSION', [
				'required' => true,
				'default_value' => static::VERSION,
				'values' => range(1, static::VERSION),
			]),
		];
	}

	public static function migrate(Main\DB\Connection $connection)
	{
		Market\Migration\StorageFacade::updateFieldsLength($connection, static::getEntity(), [ 'OFFSET', 'SETUP_TYPE', 'STEP' ]);
		static::migrateSetupType($connection);
	}

	/** @noinspection DuplicatedCode */
	protected static function migrateSetupType(Main\DB\Connection $connection)
	{
		$tableName = static::getTableName();
		$knownFields = $connection->getTableFields($tableName);

		if (isset($knownFields['SETUP_TYPE'])) { return; }

		$sqlHelper = $connection->getSqlHelper();

		Market\Migration\StorageFacade::addNewFields($connection, static::getEntity());
		Market\Migration\StorageFacade::dropPrimary($connection, static::getEntity());

		$connection->queryExecute(sprintf(
			'UPDATE %s SET %s="%s"',
			$sqlHelper->quote($tableName),
			$sqlHelper->quote('SETUP_TYPE'),
			$sqlHelper->forSql(Market\Glossary::SERVICE_EXPORT)
		));

		Market\Migration\StorageFacade::createPrimary($connection, static::getEntity());
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit