function setFreebusy( $fbType, $fbValues, $params=FALSE ) {
    $fbType = strtoupper( $fbType );
    if(( !in_array( $fbType, array( 'FREE', 'BUSY', 'BUSY-UNAVAILABLE', 'BUSY-TENTATIVE' ))) &&
       ( 'X-' != substr( $fbType, 0, 2 )))
      $fbType = 'BUSY';
    $freebusy['value'] = array( 'fbtype' => $fbType );
    foreach( $fbValues as $fbPeriod ) {   // periods => period
      $freebusyPeriod = array();
      foreach( $fbPeriod as $fbMember ) { // pairs => singlepart
        $freebusyPairMember = array();
        if( is_array( $fbMember )) {
          $cnt = count( $fbMember );
          if(( 6 == $cnt ) || ( 7 == $cnt ) || ( array_key_exists( 'year', $fbMember ))) { // date-time value
            $date = $this->_date_time_array( $fbMember, 7 );
            $date['tz'] = ( !isset( $date['tz'] )) ? 'Z' : $date['tz'];
            $freebusyPairMember = $date;
          }
          elseif( array_key_exists( 'timestamp', $fbMember )) { // timestamp value
            $tz    = ( isset( $fbMember['tz'] )) ? ' '.$fbMember['tz'] : null;
            $parno = ( !empty( $tz )) ? 7 : 6;
            $date  = $this->_date_time_string( date( 'Y-m-d H:i:s', $fbMember['timestamp'] ).$tz, $parno );
            $date['tz'] = ( !isset( $date['tz'] )) ? 'Z' : $date['tz'];
            $freebusyPairMember = $date;
          }
          else {                                         // array format duration
            $freebusyPairMember = $this->_duration_array( $fbMember );
          }
        }
        elseif(( 3 <= strlen( trim( $fbMember ))) &&    // string format duration
               ( in_array( $fbMember{0}, array( 'P', '+', '-' )))) {
          if( 'P' != $fbMember{0} )
            $fbmember = substr( $fbMember, 1 );
          $freebusyPairMember = $this->_duration_string( $fbMember );
        }
        elseif( 8 <= strlen( trim( $fbMember ))) { // ex. 2006-08-03 10:12:18
          $date = $this->_date_time_string( $fbMember, 7 );
          $date['tz'] = ( !isset( $date['tz'] )) ? 'Z' : $date['tz'];
          $freebusyPairMember = $date;
        }
        $freebusyPeriod[]  = $freebusyPairMember;
      }
      $freebusy['value'][] = $freebusyPeriod;
    }
    $freebusy['params']    = $this->_setParams( $params );
    $this->freebusy[]      = $freebusy;
  }
function setFreebusy( $fbType, $fbValues, $params=FALSE ) {
    $fbType = strtoupper( $fbType );
    if(( !in_array( $fbType, array( 'FREE', 'BUSY', 'BUSY-UNAVAILABLE', 'BUSY-TENTATIVE' ))) &&
       ( 'X-' != substr( $fbType, 0, 2 )))
      $fbType = 'BUSY';
    $freebusy['value'] = array( 'fbtype' => $fbType );
    foreach( $fbValues as $fbPeriod ) {   // periods => period
      $freebusyPeriod = array();
      foreach( $fbPeriod as $fbMember ) { // pairs => singlepart
        $freebusyPairMember = array();
        if( is_array( $fbMember )) {
          $cnt = count( $fbMember );
          if(( 6 == $cnt ) || ( 7 == $cnt ) || ( array_key_exists( 'year', $fbMember ))) { // date-time value
            $date = $this->_date_time_array( $fbMember, 7 );
            $date['tz'] = ( !isset( $date['tz'] )) ? 'Z' : $date['tz'];
            $freebusyPairMember = $date;
          }
          elseif( array_key_exists( 'timestamp', $fbMember )) { // timestamp value
            $tz    = ( isset( $fbMember['tz'] )) ? ' '.$fbMember['tz'] : null;
            $parno = ( !empty( $tz )) ? 7 : 6;
            $date  = $this->_date_time_string( date( 'Y-m-d H:i:s', $fbMember['timestamp'] ).$tz, $parno );
            $date['tz'] = ( !isset( $date['tz'] )) ? 'Z' : $date['tz'];
            $freebusyPairMember = $date;
          }
          else {                                         // array format duration
            $freebusyPairMember = $this->_duration_array( $fbMember );
          }
        }
        elseif(( 3 <= strlen( trim( $fbMember ))) &&    // string format duration
               ( in_array( $fbMember{0}, array( 'P', '+', '-' )))) {
          if( 'P' != $fbMember{0} )
            $fbmember = substr( $fbMember, 1 );
          $freebusyPairMember = $this->_duration_string( $fbMember );
        }
        elseif( 8 <= strlen( trim( $fbMember ))) { // ex. 2006-08-03 10:12:18
          $date = $this->_date_time_string( $fbMember, 7 );
          $date['tz'] = ( !isset( $date['tz'] )) ? 'Z' : $date['tz'];
          $freebusyPairMember = $date;
        }
        $freebusyPeriod[]  = $freebusyPairMember;
      }
      $freebusy['value'][] = $freebusyPeriod;
    }
    $freebusy['params']    = $this->_setParams( $params );
    $this->freebusy[]      = $freebusy;
  }
function setFreebusy ( $ fbType , $ fbValues , $ params = FALSE ) { $ fbType = strtoupper ( $ fbType ) ; if ( ( ! in_array ( $ fbType , array ( 'FREE' , 'BUSY' , 'BUSY-UNAVAILABLE' , 'BUSY-TENTATIVE' ) ) ) && ( 'X-' != substr ( $ fbType , 0 , 2 ) ) ) $ fbType = 'BUSY' ; $ freebusy [ 'value' ] = array ( 'fbtype' => $ fbType ) ; foreach ( $ fbValues as $ fbPeriod ) { // periods => period $ freebusyPeriod = array ( ) ; foreach ( $ fbPeriod as $ fbMember ) { // pairs => singlepart $ freebusyPairMember = array ( ) ; if ( is_array ( $ fbMember ) ) { $ cnt = count ( $ fbMember ) ; if ( ( 6 == $ cnt ) || ( 7 == $ cnt ) || ( array_key_exists ( 'year' , $ fbMember ) ) ) { // date-time value $ date = $ this -> _date_time_array ( $ fbMember , 7 ) ; $ date [ 'tz' ] = ( ! isset ( $ date [ 'tz' ] ) ) ? 'Z' : $ date [ 'tz' ] ; $ freebusyPairMember = $ date ; } elseif ( array_key_exists ( 'timestamp' , $ fbMember ) ) { // timestamp value $ tz = ( isset ( $ fbMember [ 'tz' ] ) ) ? ' ' . $ fbMember [ 'tz' ] : null ; $ parno = ( ! empty ( $ tz ) ) ? 7 : 6 ; $ date = $ this -> _date_time_string ( date ( 'Y-m-d H:i:s' , $ fbMember [ 'timestamp' ] ) . $ tz , $ parno ) ; $ date [ 'tz' ] = ( ! isset ( $ date [ 'tz' ] ) ) ? 'Z' : $ date [ 'tz' ] ; $ freebusyPairMember = $ date ; } else { // array format duration $ freebusyPairMember = $ this -> _duration_array ( $ fbMember ) ; } } elseif ( ( 3 <= strlen ( trim ( $ fbMember ) ) ) && // string format duration ( in_array ( $ fbMember { 0 } , array ( 'P' , '+' , '-' ) ) ) ) { if ( 'P' != $ fbMember { 0 } ) $ fbmember = substr ( $ fbMember , 1 ) ; $ freebusyPairMember = $ this -> _duration_string ( $ fbMember ) ; } elseif ( 8 <= strlen ( trim ( $ fbMember ) ) ) { // ex. 2006-08-03 10:12:18 $ date = $ this -> _date_time_string ( $ fbMember , 7 ) ; $ date [ 'tz' ] = ( ! isset ( $ date [ 'tz' ] ) ) ? 'Z' : $ date [ 'tz' ] ; $ freebusyPairMember = $ date ; } $ freebusyPeriod [ ] = $ freebusyPairMember ; } $ freebusy [ 'value' ] [ ] = $ freebusyPeriod ; } $ freebusy [ 'params' ] = $ this -> _setParams ( $ params ) ; $ this -> freebusy [ ] = $ freebusy ; }
set calendar component property freebusy

@author Kjell-Inge Gustafsson <ical@kigkonsult.se>
@since 0.9.18 - 2007-03-18
@param string $fbType
@param array $fbValues
@param array $params optional
@return void
set calendar component property freebusy