This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace ProjectName\Helper; | |
use Bitrix\Im\Helper; | |
use Bitrix\Sale\Internals\OrderPropsTable; | |
use Bitrix\Main\Entity\ReferenceField; | |
use Bitrix\Sale\Internals\UserPropsTable; | |
use CSaleOrderUserProps; | |
use CSaleOrderUserPropsValue; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Project\Helper; | |
use Bitrix\Im\Helper; | |
use Bitrix\Sale\Internals\OrderPropsTable; | |
use Bitrix\Main\Entity\ReferenceField; | |
use Bitrix\Sale\Internals\UserPropsTable; | |
use CSaleOrderUserProps; | |
use CSaleOrderUserPropsValue; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$iblockId = \Bitrix\Iblock\ElementTable::getByPrimary($productIds[0])->fetchObject()->getIblockId(); | |
$iblock = Iblock::wakeUp($iblockId); | |
$elements = $iblock->getEntityDataClass()::getList([ | |
'select' => ['ID', 'CML2_CODE'], | |
'filter' => ['ID' => $productIds] | |
])->fetchcollection(); | |
foreach ($elements as $element) { | |
if ($element->get('CML2_CODE')) { | |
$codes[$element->get('ID')] = $element->get('CML2_CODE')->getValue(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static function getProfileFieldsById(array $profileIds): array | |
{ | |
$arPropertyValues = []; | |
$propertyValues = UserPropsValueTable::getList( | |
[ | |
'select' => ['ID', 'USER_PROPS_ID', 'ORDER_PROPS_ID', 'NAME', 'VALUE', 'PROPERTY'], | |
'filter' => ['USER_PROPS_ID' => $profileIds], | |
] | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
$MODULE_ID = "Идентификатор модуля". | |
// -------------- СОХРАНЕНИЕ -------------- | |
// ПО ОТДЕЛЬНОСТИ | |
foreach($arOptions as $arOption) { | |
__AdmSettingsSaveOption($MODULE_ID, $arOption); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
trait Additional | |
{ | |
public function nine() | |
{ | |
echo "nine \n"; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$entity = \Bitrix\Iblock\Model\Section::compileEntityByIblock($arParams['IBLOCK_ID']); | |
$section = $entity::getList([ | |
'select' => ['DEPTH_LEVEL', 'DESCRIPTION', 'UF_SEO_TEXT_TITLE', 'NAME'], | |
'filter' => ['ID' => $arResult['VARIABLES']['SECTION_ID']], | |
'cache' => ['ttl' => 36000], | |
])->Fetch(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static function getPagesForOutput(): array | |
{ | |
$property = PropertyTable::getList([ | |
'select' => ['ID', 'CODE'], | |
'filter' => ['CODE' => ['SECTIONS', 'PAGES']] | |
])->FetchAll(); | |
$result = [ | |
'PROPERTY' => [], | |
'PROPERTY_ID' => [], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$arUserGroup = Bitrix\Main\UserGroupTable::getList([ | |
'filter' => [], | |
'select' => ['*'], | |
])->FetchAll(); | |
$arResult = []; | |
foreach($arUserGroup as $itemUser){ | |
$arResult[$itemUser['USER_ID']][] = $itemUser['GROUP_ID']; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Pinkbrain; | |
use Bitrix\Main\Loader; | |
use Bitrix\Iblock\PropertyTable; | |
use Bitrix\Iblock\ElementPropertyTable; | |
use Bitrix\Catalog\ProductTable; | |
class Product |
NewerOlder