src/wcmf/lib/model/Node.php
public function getChildrenEx(ObjectId $oid=null, $role=null, $type=null, $values=null,
          $properties=null, $useRegExp=true) {
    if ($role != null) {
      // nodes of a given role are requested
      // make sure it is a child role
      $childRoles = $this->getPossibleChildren();
      if (!isset($childRoles[$role])) {
        throw new IllegalArgumentException("No child role defined with name: ".$role);
      }
      // we are only looking for nodes that are in memory already
      $nodes = parent::getValue($role);
      if (!is_array($nodes)) {
        $nodes = [$nodes];
      }
      // sort out proxies
      $children = [];
      foreach($nodes as $curNode) {
        if ($curNode instanceof PersistentObject) {
          $children[] = $curNode;
        }
      }
      return self::filter($children, $oid, $type, $values, $properties, $useRegExp);
    }
    else {
      return self::filter($this->getChildren(), $oid, $type, $values, $properties, $useRegExp);
    }
  }
public function getChildrenEx(ObjectId $oid=null, $role=null, $type=null, $values=null,
          $properties=null, $useRegExp=true) {
    if ($role != null) {
      // nodes of a given role are requested
      // make sure it is a child role
      $childRoles = $this->getPossibleChildren();
      if (!isset($childRoles[$role])) {
        throw new IllegalArgumentException("No child role defined with name: ".$role);
      }
      // we are only looking for nodes that are in memory already
      $nodes = parent::getValue($role);
      if (!is_array($nodes)) {
        $nodes = [$nodes];
      }
      // sort out proxies
      $children = [];
      foreach($nodes as $curNode) {
        if ($curNode instanceof PersistentObject) {
          $children[] = $curNode;
        }
      }
      return self::filter($children, $oid, $type, $values, $properties, $useRegExp);
    }
    else {
      return self::filter($this->getChildren(), $oid, $type, $values, $properties, $useRegExp);
    }
  }
public function getChildrenEx ( ObjectId $ oid = null , $ role = null , $ type = null , $ values = null , $ properties = null , $ useRegExp = true ) { if ( $ role != null ) { // nodes of a given role are requested // make sure it is a child role $ childRoles = $ this -> getPossibleChildren ( ) ; if ( ! isset ( $ childRoles [ $ role ] ) ) { throw new IllegalArgumentException ( "No child role defined with name: " . $ role ) ; } // we are only looking for nodes that are in memory already $ nodes = parent :: getValue ( $ role ) ; if ( ! is_array ( $ nodes ) ) { $ nodes = [ $ nodes ] ; } // sort out proxies $ children = [ ] ; foreach ( $ nodes as $ curNode ) { if ( $ curNode instanceof PersistentObject ) { $ children [ ] = $ curNode ; } } return self :: filter ( $ children , $ oid , $ type , $ values , $ properties , $ useRegExp ) ; } else { return self :: filter ( $ this -> getChildren ( ) , $ oid , $ type , $ values , $ properties , $ useRegExp ) ; } }
Get the children that match given conditions.
@note This method will only return objects that are already loaded, to get all objects in
the given relation (including proxies), use the Node::getValue() method and filter the returned
list afterwards.
@param $oid The object id that the children should match (optional, default: _null_).
@param $role The role that the children should match (optional, default: _null_).
@param $type The type that the children should match (either fully qualified or simple, if not ambiguous)
(optional, default: _null_).
@param $values An associative array holding key value pairs that the children values should match (optional, default: _null_).
@param $properties An associative array holding key value pairs that the children properties should match (optional, default: _null_).
@param $useRegExp Boolean whether to interpret the given values/properties as regular expressions or not (default: _true_)
@return Array containing children Nodes that matched (proxies not included).
Get the children that match given conditions .