Logo Search packages:      
Sourcecode: davical version File versions  Download package

& iCalDate::ApplyBySetPos ( bysplist,
set 
)

Given set position descriptions like '1', '3', '11', '-3' or '-1' and a set, return the subset matching the list of set positions.

Parameters:
string$bysplistThe list of set positions.
string$setThe set of days that we will apply the positions to.
Returns:
array The subset which matches.

Definition at line 553 of file RRule.php.

                                           {
    dbg_error_log( "RRule", " ApplyBySetPos: Applying set position '%s' to set of %d days", $bysplist, count($set) );
    $subset = array();
    sort( $set, SORT_NUMERIC );
    $max = count($set);
    $positions = split( '[^0-9-]', $bysplist );
    foreach( $positions AS $k => $v ) {
      if ( $v < 0 ) {
        $v += $max;
      }
      else {
        $v--;
      }
      $subset[$set[$v]] = $set[$v];
    }
    return $subset;
  }

Generated by  Doxygen 1.6.0   Back to index