Jarves\Jarves::getBundles PHP Method

getBundles() public method

Returns all Symfony Bundles.
public getBundles ( ) : Symfony\Component\HttpKernel\Bundle\BundleInterface[]
return Symfony\Component\HttpKernel\Bundle\BundleInterface[]
    public function getBundles()
    {
        $bundles = [];
        foreach ($this->kernel->getBundles() as $bundleName => $bundle) {
            $bundles[$bundleName] = $bundle;
        }
        return $bundles;
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * {@inheritDoc}
  */
 public function getBranch($pk = null, Condition $condition = null, $depth = 1, $scope = null, $options = null)
 {
     $result = null;
     if (!$pk || !$pk['path']) {
         return [['path' => '/', 'title' => 'Admin Access']];
     } else {
         if ('/' == $pk['path']) {
             foreach ($this->jarves->getBundles() as $bundle) {
                 $item = array('path' => $bundle->getName(), 'title' => $bundle->getName());
                 $this->setChildren(strtolower($bundle->getName()), $item, $depth);
                 $result[] = $item;
             }
         } else {
             self::normalizePath($pk['path']);
             $adminUtils = new \Jarves\Admin\Utils($this->jarves);
             $entryPoint = $adminUtils->getEntryPoint($pk['path']);
             if ($entryPoint && $entryPoint->getChildren()) {
                 foreach ($entryPoint->getChildren() as $entryPoint) {
                     $item = array('path' => $pk['path'] . '/' . $entryPoint->getPath(), 'type' => $entryPoint->getType(), 'title' => $entryPoint->getLabel() ? $entryPoint->getLabel() : $entryPoint->getPath());
                     $this->setChildren($pk['path'] . '/' . $entryPoint->getPath(), $item, $depth);
                     $result[] = $item;
                 }
             }
         }
     }
     return $result;
 }
All Usage Examples Of Jarves\Jarves::getBundles