src/wcmf/application/controller/XMLExportController.php
protected function getNumUnvisitedChildren(Node $node) {
    $cacheSection = $this->getRequestValue('cacheSection');
    $exportedOids = $this->cache->get($cacheSection, self::CACHE_KEY_EXPORTED_OIDS);

    $childOIDs = [];
    $mapper = $node->getMapper();
    $relations = $mapper->getRelations('child');
    foreach ($relations as $relation) {
      if ($relation->getOtherNavigability()) {
        $childValue = $node->getValue($relation->getOtherRole());
        if ($childValue != null) {
          $children = $relation->isMultiValued() ? $childValue : [$childValue];
          foreach ($children as $child) {
            $childOIDs[] = $child->getOID();
          }
        }
      }
    }
    $numUnvisitedChildren = 0;
    foreach ($childOIDs as $childOid) {
      if (!in_array($childOid->__toString(), $exportedOids)) {
        $numUnvisitedChildren++;
      }
    }
    return $numUnvisitedChildren;
  }
protected function getNumUnvisitedChildren(Node $node) {
    $cacheSection = $this->getRequestValue('cacheSection');
    $exportedOids = $this->cache->get($cacheSection, self::CACHE_KEY_EXPORTED_OIDS);

    $childOIDs = [];
    $mapper = $node->getMapper();
    $relations = $mapper->getRelations('child');
    foreach ($relations as $relation) {
      if ($relation->getOtherNavigability()) {
        $childValue = $node->getValue($relation->getOtherRole());
        if ($childValue != null) {
          $children = $relation->isMultiValued() ? $childValue : [$childValue];
          foreach ($children as $child) {
            $childOIDs[] = $child->getOID();
          }
        }
      }
    }
    $numUnvisitedChildren = 0;
    foreach ($childOIDs as $childOid) {
      if (!in_array($childOid->__toString(), $exportedOids)) {
        $numUnvisitedChildren++;
      }
    }
    return $numUnvisitedChildren;
  }
protected function getNumUnvisitedChildren ( Node $ node ) { $ cacheSection = $ this -> getRequestValue ( 'cacheSection' ) ; $ exportedOids = $ this -> cache -> get ( $ cacheSection , self :: CACHE_KEY_EXPORTED_OIDS ) ; $ childOIDs = [ ] ; $ mapper = $ node -> getMapper ( ) ; $ relations = $ mapper -> getRelations ( 'child' ) ; foreach ( $ relations as $ relation ) { if ( $ relation -> getOtherNavigability ( ) ) { $ childValue = $ node -> getValue ( $ relation -> getOtherRole ( ) ) ; if ( $ childValue != null ) { $ children = $ relation -> isMultiValued ( ) ? $ childValue : [ $ childValue ] ; foreach ( $ children as $ child ) { $ childOIDs [ ] = $ child -> getOID ( ) ; } } } } $ numUnvisitedChildren = 0 ; foreach ( $ childOIDs as $ childOid ) { if ( ! in_array ( $ childOid -> __toString ( ) , $ exportedOids ) ) { $ numUnvisitedChildren ++ ; } } return $ numUnvisitedChildren ; }
Get number of children of the given node, that were not visited yet
@param $node
@return Integer
Get number of children of the given node that were not visited yet