source/Spiral/ORM/Entities/Relations/MultipleRelation.php
protected function initInstances(): self
    {
        if (is_array($this->data) && !empty($this->data)) {
            //Iterates and instantiate records
            $iterator = new RecordIterator($this->data, $this->class, $this->orm);

            foreach ($iterator as $item) {
                if (in_array($item, $this->instances, true)) {
                    //Skip duplicates
                    continue;
                }

                $this->instances[] = $item;
            }
        }

        //Memory free
        $this->data = null;

        return $this;
    }
protected function initInstances(): self
    {
        if (is_array($this->data) && !empty($this->data)) {
            //Iterates and instantiate records
            $iterator = new RecordIterator($this->data, $this->class, $this->orm);

            foreach ($iterator as $item) {
                if (in_array($item, $this->instances, true)) {
                    //Skip duplicates
                    continue;
                }

                $this->instances[] = $item;
            }
        }

        //Memory free
        $this->data = null;

        return $this;
    }
protected function initInstances ( ) : self { if ( is_array ( $ this -> data ) && ! empty ( $ this -> data ) ) { //Iterates and instantiate records $ iterator = new RecordIterator ( $ this -> data , $ this -> class , $ this -> orm ) ; foreach ( $ iterator as $ item ) { if ( in_array ( $ item , $ this -> instances , true ) ) { //Skip duplicates continue ; } $ this -> instances [ ] = $ item ; } } //Memory free $ this -> data = null ; return $ this ; }
Init pre-loaded data.

@return HasManyRelation|self
Init pre - loaded data .