src/wcmf/application/controller/ListController.php
protected function modifyModel(&$nodes) {
    $request = $this->getRequest();
    // TODO: put this into subclass ListController

    // remove all attributes except for display values
    if ($request->getBooleanValue('completeObjects', false) == false) {
      for($i=0,$count=sizeof($nodes); $i<$count; $i++) {
        $node = $nodes[$i];
        $displayValues = $request->hasValue('values') ? array_map('trim', explode(',', $request->getValue('values'))) :
          $node->getProperty('displayValues');
        $valueNames = array_merge($node->getValueNames(), $node->getRelationNames());
        foreach($valueNames as $name) {
          if (!in_array($name, $displayValues)) {
            $node->removeValue($name);
          }
        }
      }
    }
    // render values
    if ($request->getBooleanValue('translateValues', false) == true) {
      NodeUtil::translateValues($nodes);
    }
  }
protected function modifyModel(&$nodes) {
    $request = $this->getRequest();
    // TODO: put this into subclass ListController

    // remove all attributes except for display values
    if ($request->getBooleanValue('completeObjects', false) == false) {
      for($i=0,$count=sizeof($nodes); $i<$count; $i++) {
        $node = $nodes[$i];
        $displayValues = $request->hasValue('values') ? array_map('trim', explode(',', $request->getValue('values'))) :
          $node->getProperty('displayValues');
        $valueNames = array_merge($node->getValueNames(), $node->getRelationNames());
        foreach($valueNames as $name) {
          if (!in_array($name, $displayValues)) {
            $node->removeValue($name);
          }
        }
      }
    }
    // render values
    if ($request->getBooleanValue('translateValues', false) == true) {
      NodeUtil::translateValues($nodes);
    }
  }
protected function modifyModel ( & $ nodes ) { $ request = $ this -> getRequest ( ) ; // TODO: put this into subclass ListController // remove all attributes except for display values if ( $ request -> getBooleanValue ( 'completeObjects' , false ) == false ) { for ( $ i = 0 , $ count = sizeof ( $ nodes ) ; $ i < $ count ; $ i ++ ) { $ node = $ nodes [ $ i ] ; $ displayValues = $ request -> hasValue ( 'values' ) ? array_map ( 'trim' , explode ( ',' , $ request -> getValue ( 'values' ) ) ) : $ node -> getProperty ( 'displayValues' ) ; $ valueNames = array_merge ( $ node -> getValueNames ( ) , $ node -> getRelationNames ( ) ) ; foreach ( $ valueNames as $ name ) { if ( ! in_array ( $ name , $ displayValues ) ) { $ node -> removeValue ( $ name ) ; } } } } // render values if ( $ request -> getBooleanValue ( 'translateValues' , false ) == true ) { NodeUtil :: translateValues ( $ nodes ) ; } }
Modify the model passed to the view.
@note subclasses will override this to implement special application requirements.
@param $nodes A reference to the array of Node instances passed to the view
Modify the model passed to the view .