public function ofOneOfTheseTypes($types)
    {
        $items = [];

        foreach ($this->items as $path => $slug) {
            $page = $this->pages->get($path);
            if ($page !== null && \in_array($page->template(), $types, true)) {
                $items[$path] = $slug;
            }
        }

        $this->items = $items;

        return $this;
    }
public function ofOneOfTheseTypes($types)
    {
        $items = [];

        foreach ($this->items as $path => $slug) {
            $page = $this->pages->get($path);
            if ($page !== null && \in_array($page->template(), $types, true)) {
                $items[$path] = $slug;
            }
        }

        $this->items = $items;

        return $this;
    }
public function ofOneOfTheseTypes ( $ types ) { $ items = [ ] ; foreach ( $ this -> items as $ path => $ slug ) { $ page = $ this -> pages -> get ( $ path ) ; if ( $ page !== null && \ in_array ( $ page -> template ( ) , $ types , true ) ) { $ items [ $ path ] = $ slug ; } } $ this -> items = $ items ; return $ this ; }
Creates new collection with only pages of one of the specified types

@param string[] $types

@return Collection The collection
Creates new collection with only pages of one of the specified types