Skip to content

Instantly share code, notes, and snippets.

@Qetbn
Qetbn / .gitignore
Last active January 20, 2019 14:05
.gitignore Bitrix with core (Битрикс с ядром)
# SEO
/robots.txt
/sitemap.xml
/sitemap_files.xml
/sitemap_iblock_*.xml
# 1C-Bitrix
/bitrix/cache
/bitrix/controller_log
/bitrix/managed_cache
\Bitrix\Main\Application::getConnection() ->startTracker();
$result = ExampleTable::getList();
\Bitrix\Main\Application::getConnection()->stopTracker();
print_r($result->getTrackerQuery()->getSql());
@Qetbn
Qetbn / bitrix_d7_match_against.php
Last active January 20, 2019 13:57
Bitrix D7 Match Against Битрикс
<?
/**
* Пример работы с конструкцией match against в ядре d7 Битрикс
*/
use \Bitrix\Main\Entity;
use \Bitrix\Main\Application;
use \Bitrix\Main\DB;
$myIterator = MyTable::getList(array(
'runtime' => array(
new Entity\ExpressionField('1', '1'),
<?
/**
* Class SimpleCoupons
*
* Класс для генерации купонов для существующей скидки в 1С-Битрикс
* Необходимые модули: catalog
*/
class SimpleCoupons
{
protected $length = 4;