src/wcmf/application/controller/TreeController.php
protected function getRootTypes() {
    $types = null;
    $config = $this->getConfiguration();

    // get root types from configuration
    // try request value first
    $request = $this->getRequest();
    $rootTypeVar = $request->getValue('rootTypes');
    if ($config->hasValue($rootTypeVar, 'application')) {
      $types = $config->getValue($rootTypeVar, 'application');
      if (!is_array($types)) {
        $types = null;
      }
    }
    if ($types == null) {
      // fall back to root types
      $types = $config->hasValue('rootTypes', 'application');
    }

    // filter types by read permission
    $permissionManager = $this->getPermissionManager();
    $persistenceFacade = $this->getPersistenceFacade();
    $nodes = [];
    foreach($types as $type) {
      if ($permissionManager->authorize($type, '', PersistenceAction::READ)) {
        $node = $persistenceFacade->create($type, BuildDepth::SINGLE);
        $nodes[] = $node;
      }
    }
    return $nodes;
  }
protected function getRootTypes() {
    $types = null;
    $config = $this->getConfiguration();

    // get root types from configuration
    // try request value first
    $request = $this->getRequest();
    $rootTypeVar = $request->getValue('rootTypes');
    if ($config->hasValue($rootTypeVar, 'application')) {
      $types = $config->getValue($rootTypeVar, 'application');
      if (!is_array($types)) {
        $types = null;
      }
    }
    if ($types == null) {
      // fall back to root types
      $types = $config->hasValue('rootTypes', 'application');
    }

    // filter types by read permission
    $permissionManager = $this->getPermissionManager();
    $persistenceFacade = $this->getPersistenceFacade();
    $nodes = [];
    foreach($types as $type) {
      if ($permissionManager->authorize($type, '', PersistenceAction::READ)) {
        $node = $persistenceFacade->create($type, BuildDepth::SINGLE);
        $nodes[] = $node;
      }
    }
    return $nodes;
  }
protected function getRootTypes ( ) { $ types = null ; $ config = $ this -> getConfiguration ( ) ; // get root types from configuration // try request value first $ request = $ this -> getRequest ( ) ; $ rootTypeVar = $ request -> getValue ( 'rootTypes' ) ; if ( $ config -> hasValue ( $ rootTypeVar , 'application' ) ) { $ types = $ config -> getValue ( $ rootTypeVar , 'application' ) ; if ( ! is_array ( $ types ) ) { $ types = null ; } } if ( $ types == null ) { // fall back to root types $ types = $ config -> hasValue ( 'rootTypes' , 'application' ) ; } // filter types by read permission $ permissionManager = $ this -> getPermissionManager ( ) ; $ persistenceFacade = $ this -> getPersistenceFacade ( ) ; $ nodes = [ ] ; foreach ( $ types as $ type ) { if ( $ permissionManager -> authorize ( $ type , '' , PersistenceAction :: READ ) ) { $ node = $ persistenceFacade -> create ( $ type , BuildDepth :: SINGLE ) ; $ nodes [ ] = $ node ; } } return $ nodes ; }
Get all root types
@return Array of Node instances
Get all root types