traits/helpers/TraitCached.php
public function addCachedField($arFieldList)
    {
        if (empty($arFieldList)) {
            return;
        }

        if (empty($this->cached) || !is_array($this->cached)) {
            $this->cached = [];
        }

        if (is_string($arFieldList)) {
            $arFieldList = [$arFieldList];
        }

        $this->cached = array_merge($this->cached, $arFieldList);
        $this->cached = array_unique($this->cached);
    }
public function addCachedField($arFieldList)
    {
        if (empty($arFieldList)) {
            return;
        }

        if (empty($this->cached) || !is_array($this->cached)) {
            $this->cached = [];
        }

        if (is_string($arFieldList)) {
            $arFieldList = [$arFieldList];
        }

        $this->cached = array_merge($this->cached, $arFieldList);
        $this->cached = array_unique($this->cached);
    }
public function addCachedField ( $ arFieldList ) { if ( empty ( $ arFieldList ) ) { return ; } if ( empty ( $ this -> cached ) || ! is_array ( $ this -> cached ) ) { $ this -> cached = [ ] ; } if ( is_string ( $ arFieldList ) ) { $ arFieldList = [ $ arFieldList ] ; } $ this -> cached = array_merge ( $ this -> cached , $ arFieldList ) ; $ this -> cached = array_unique ( $ this -> cached ) ; }
Add fields to cached field list
@param array|string $arFieldList
Add fields to cached field list