src/LinkCollector.php
public function generateCollections()
	{
		$collections = $this->collections;
		$this->collections = [];

		foreach ($collections as $category => $detail)
		{
			foreach ($detail['class'] as $class) {
				if (!in_array(ILinkCollection::class, class_implements($class))) {
					throw new \LogicException("Collection must implement 'Grapesc\GrapeFluid\LinkCollector\ILinkCollection' interface");
				}
				if (!isset($detail['name'])) {
					$detail['name'] = $category;
				}
				$detail['icon'] = isset($detail['icon']) ? $detail['icon'] : "";

				/** @var ILinkCollection $collection */
				$collection = new $class;
				$this->container->callInjects($collection);
				$this->addCollection($category, $detail['name'], $detail['icon'], $collection->getLinks());
			}
		}
	}
public function generateCollections()
	{
		$collections = $this->collections;
		$this->collections = [];

		foreach ($collections as $category => $detail)
		{
			foreach ($detail['class'] as $class) {
				if (!in_array(ILinkCollection::class, class_implements($class))) {
					throw new \LogicException("Collection must implement 'Grapesc\GrapeFluid\LinkCollector\ILinkCollection' interface");
				}
				if (!isset($detail['name'])) {
					$detail['name'] = $category;
				}
				$detail['icon'] = isset($detail['icon']) ? $detail['icon'] : "";

				/** @var ILinkCollection $collection */
				$collection = new $class;
				$this->container->callInjects($collection);
				$this->addCollection($category, $detail['name'], $detail['icon'], $collection->getLinks());
			}
		}
	}
public function generateCollections ( ) { $ collections = $ this -> collections ; $ this -> collections = [ ] ; foreach ( $ collections as $ category => $ detail ) { foreach ( $ detail [ 'class' ] as $ class ) { if ( ! in_array ( ILinkCollection :: class , class_implements ( $ class ) ) ) { throw new \ LogicException ( "Collection must implement 'Grapesc\GrapeFluid\LinkCollector\ILinkCollection' interface" ) ; } if ( ! isset ( $ detail [ 'name' ] ) ) { $ detail [ 'name' ] = $ category ; } $ detail [ 'icon' ] = isset ( $ detail [ 'icon' ] ) ? $ detail [ 'icon' ] : "" ; /** @var ILinkCollection $collection */ $ collection = new $ class ; $ this -> container -> callInjects ( $ collection ) ; $ this -> addCollection ( $ category , $ detail [ 'name' ] , $ detail [ 'icon' ] , $ collection -> getLinks ( ) ) ; } } }
Vygeneruje seznam kolekci dle vsech nakonfigurovanich Collection
Collection musi implementovat \Grapesc\GrapeFluid\LinkCollector\ILinkCollection
Vygeneruje seznam kolekci dle vsech nakonfigurovanich Collection Collection musi implementovat \ Grapesc \ GrapeFluid \ LinkCollector \ ILinkCollection