PHP code example of bitrix-expert / tools

1. Go to this page and download the library: Download bitrix-expert/tools library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

bitrix-expert / tools example snippets



use Bex\Tools\Iblock\IblockTools;

$iblockFinder = IblockTools::find('iblock_type', 'iblock_code');

$iblockId = $iblockFinder->id();
$propEnumId = $iblockFinder->propEnumId('PROP_CODE', 'VALUE_XML_ID');

// And much more…


use Bex\Tools\Group\GroupTools;

$groupFinder = GroupTools::find('group_code');

$groupId = $groupFinder->id();
$groupCode = GroupTools::findById(3)->code();

// And that's not all ;-)


use Bex\Tools\HlBlock\HlBlockTools;

$hlBlockFinder = HlBlockTools::find('ReferenceName');

$hlBlockId = $hlBlockFinder->id();
$hlBlockName = HlBlockTools::findById(2)->name();



use Bex\Tools\Catalog\GroupTools;

$catalogGroupFinder = GroupTools::find('RETAIL');
$priceTypeId = $catalogGroupFinder->id();

$priceTypeName = GroupTools::findBase()->name();