classes/collection/ElementCollection.php
public function intersect($arElementIDList)
    {
        if (empty($arElementIDList)) {
            return $this->clear();
        }

        if ($this->isClear()) {
            $this->arElementIDList = $arElementIDList;

            return $this->returnThis();
        }

        $this->arElementIDList = array_combine($this->arElementIDList, $this->arElementIDList);
        $arElementIDList = array_combine($arElementIDList, $arElementIDList);

        $this->arElementIDList = array_intersect_key($this->arElementIDList, $arElementIDList);

        return $this->returnThis();
    }
public function intersect($arElementIDList)
    {
        if (empty($arElementIDList)) {
            return $this->clear();
        }

        if ($this->isClear()) {
            $this->arElementIDList = $arElementIDList;

            return $this->returnThis();
        }

        $this->arElementIDList = array_combine($this->arElementIDList, $this->arElementIDList);
        $arElementIDList = array_combine($arElementIDList, $arElementIDList);

        $this->arElementIDList = array_intersect_key($this->arElementIDList, $arElementIDList);

        return $this->returnThis();
    }
public function intersect ( $ arElementIDList ) { if ( empty ( $ arElementIDList ) ) { return $ this -> clear ( ) ; } if ( $ this -> isClear ( ) ) { $ this -> arElementIDList = $ arElementIDList ; return $ this -> returnThis ( ) ; } $ this -> arElementIDList = array_combine ( $ this -> arElementIDList , $ this -> arElementIDList ) ; $ arElementIDList = array_combine ( $ arElementIDList , $ arElementIDList ) ; $ this -> arElementIDList = array_intersect_key ( $ this -> arElementIDList , $ arElementIDList ) ; return $ this -> returnThis ( ) ; }
Apply array_intersect for element array list
@see  \Lovata\Toolbox\Tests\Unit\CollectionTest::testIntersectMethod()
@link https://github.com/lovata/oc-toolbox-plugin/wiki/ElementCollection#intersectarelementidlist
@param array $arElementIDList
@return $this
Apply array_intersect for element array list