src/wcmf/application/controller/TreeController.php
protected function getChildren($oid) {
    $permissionManager = $this->getPermissionManager();
    $persistenceFacade = $this->getPersistenceFacade();

    // check read permission on type
    $type = $oid->getType();
    if (!$permissionManager->authorize($type, '', PersistenceAction::READ)) {
      return [];
    }

    $objectsTmp = [];
    if ($this->isRootTypeNode($oid)) {
      // load instances of type
      $objectsTmp = $persistenceFacade->loadObjects($type, BuildDepth::SINGLE);
    }
    else {
      // load children of node
      if ($permissionManager->authorize($oid, '', PersistenceAction::READ)) {
        $node = $persistenceFacade->load($oid, 1);
        if ($node) {
          $objectsTmp = $node->getChildren();
        }
      }
    }

    // check read permission on instances
    $objects = [];
    foreach ($objectsTmp as $object) {
      if ($permissionManager->authorize($object->getOID(), '', PersistenceAction::READ)) {
        $objects[] = $object;
      }
    }

    return $objects;
  }
protected function getChildren($oid) {
    $permissionManager = $this->getPermissionManager();
    $persistenceFacade = $this->getPersistenceFacade();

    // check read permission on type
    $type = $oid->getType();
    if (!$permissionManager->authorize($type, '', PersistenceAction::READ)) {
      return [];
    }

    $objectsTmp = [];
    if ($this->isRootTypeNode($oid)) {
      // load instances of type
      $objectsTmp = $persistenceFacade->loadObjects($type, BuildDepth::SINGLE);
    }
    else {
      // load children of node
      if ($permissionManager->authorize($oid, '', PersistenceAction::READ)) {
        $node = $persistenceFacade->load($oid, 1);
        if ($node) {
          $objectsTmp = $node->getChildren();
        }
      }
    }

    // check read permission on instances
    $objects = [];
    foreach ($objectsTmp as $object) {
      if ($permissionManager->authorize($object->getOID(), '', PersistenceAction::READ)) {
        $objects[] = $object;
      }
    }

    return $objects;
  }
protected function getChildren ( $ oid ) { $ permissionManager = $ this -> getPermissionManager ( ) ; $ persistenceFacade = $ this -> getPersistenceFacade ( ) ; // check read permission on type $ type = $ oid -> getType ( ) ; if ( ! $ permissionManager -> authorize ( $ type , '' , PersistenceAction :: READ ) ) { return [ ] ; } $ objectsTmp = [ ] ; if ( $ this -> isRootTypeNode ( $ oid ) ) { // load instances of type $ objectsTmp = $ persistenceFacade -> loadObjects ( $ type , BuildDepth :: SINGLE ) ; } else { // load children of node if ( $ permissionManager -> authorize ( $ oid , '' , PersistenceAction :: READ ) ) { $ node = $ persistenceFacade -> load ( $ oid , 1 ) ; if ( $ node ) { $ objectsTmp = $ node -> getChildren ( ) ; } } } // check read permission on instances $ objects = [ ] ; foreach ( $ objectsTmp as $ object ) { if ( $ permissionManager -> authorize ( $ object -> getOID ( ) , '' , PersistenceAction :: READ ) ) { $ objects [ ] = $ object ; } } return $ objects ; }
Get the children for a given oid.
@param $oid The object id
@return Array of Node instances.
Get the children for a given oid .