public function getCollectionForItem(ItemInterface $item)
    {
        foreach ($this->colectionItemCollection as $name => $collection) {
            $itemPath = $item->getPath(ItemInterface::SNAPSHOT_PATH_RELATIVE).'/';
            $collectionPath = $collection->getPath().'/';

            if (strpos($itemPath, $collectionPath) === 0) {
                return $collection;
            }
        }

        return $this->colectionItemCollection->get('pages');
    }
public function getCollectionForItem(ItemInterface $item)
    {
        foreach ($this->colectionItemCollection as $name => $collection) {
            $itemPath = $item->getPath(ItemInterface::SNAPSHOT_PATH_RELATIVE).'/';
            $collectionPath = $collection->getPath().'/';

            if (strpos($itemPath, $collectionPath) === 0) {
                return $collection;
            }
        }

        return $this->colectionItemCollection->get('pages');
    }
public function getCollectionForItem ( ItemInterface $ item ) { foreach ( $ this -> colectionItemCollection as $ name => $ collection ) { $ itemPath = $ item -> getPath ( ItemInterface :: SNAPSHOT_PATH_RELATIVE ) . '/' ; $ collectionPath = $ collection -> getPath ( ) . '/' ; if ( strpos ( $ itemPath , $ collectionPath ) === 0 ) { return $ collection ; } } return $ this -> colectionItemCollection -> get ( 'pages' ) ; }
Collection matching of a item.

@return \Yosymfony\Spress\Core\ContentManager\Collection\CollectionInterface
Collection matching of a item .