Issues (53)

src/Iblock/IblockElementTable.php (4 issues)

1
<?php
2
3
namespace Alex19pov31\BitrixHelper\Iblock;
4
5
use Bitrix\Iblock\ElementTable;
0 ignored issues
show
The type Bitrix\Iblock\ElementTable was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Bitrix\Main\ORM\Data\DataManager;
0 ignored issues
show
The type Bitrix\Main\ORM\Data\DataManager was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
use Bitrix\Main\ORM\Fields\Relations\Reference;
0 ignored issues
show
The type Bitrix\Main\ORM\Fields\Relations\Reference was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
9
abstract class IblockElementTable extends ElementTable
10
{
11
    const TTL = 180;
12
    protected static $iblockCode;
13
    protected static $iblockId;
14
    
15
    private function __construct(string $iblockCode) {
16
        $this->iblockCode = $iblockCode;
17
        $this->iblockId = getIblockId($iblockCode, null, static::TTL);
18
    }
19
20
    public static function init(string $iblockCode) {
21
        return new static($iblockCode);
22
    }
23
24
    public static function getList(array $parameters = [])
25
    {
26
        initTagCache([
27
            'iblock_code_'.static::$iblockCode,
28
            'iblock_id_'.static::$iblockId,
29
        ]);
30
        $parameters['filter']['IBLOCK_ID'] = static::$iblockId;
31
    }
32
33
    public static function getMap()
34
    {
35
        $map = parent::getMap();
36
        $map['PROPERTIES'] = new Reference(
37
            'PROPERTIES',
38
            static::getPropertiesClass(),
39
            ['=this.ID' => 'ref.IBLOCK_ELEMENT_ID'],
40
            ['join_type' => 'LEFT']
41
        );
42
43
        return $map;
44
    }
45
46
    private static function getPropertiesClass(): IblockPropertyTable
47
    {
48
        $code = static::IBLOCK_CODE;
0 ignored issues
show
The assignment to $code is dead and can be removed.
Loading history...
49
        return new class(static::IBLOCK_CODE) extends IblockPropertyTable {
50
        };
51
    }
52
}
53