Back to index

d-push  2.0
Public Member Functions | Public Attributes | Protected Attributes
SyncAppointment Class Reference
Inheritance diagram for SyncAppointment:
Inheritance graph
[legend]
Collaboration diagram for SyncAppointment:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 SyncAppointment ()
 Check ($logAsDebug=false)
 Method checks if the object has the minimum of required parameters and fullfills semantic dependencies.
 SyncObject ($mapping)
 emptySupported ($supportedFields)
 Sets all supported but not transmitted variables of this SyncObject to an "empty" value, so they are deleted when being saved.
 equals ($odo, $log=false)
 Compares this a SyncObject to another.
 __toString ()
 String representation of the object.
 getUnsetVars ()
 Returns the properties which have to be unset on the server.
 Streamer ($mapping)
 Constructor.
 Decode (&$decoder)
 Decodes the WBXML from a WBXMLdecoder until we reach the same depth level of WBXML.
 Encode (&$encoder)
 Encodes this object and any subobjects - output is ordered according to mapping.
 StripData ()
 Removes not necessary data from the object.
 serialize ()
 Method to serialize a Streamer and respective SyncObject.
 unserialize ($data)
 Method to unserialize a Streamer and respective SyncObject.
 parseDate ($ts)
 Transforms an AS timestamp into a unix timestamp.

Public Attributes

 $timezone
 $dtstamp
 $starttime
 $subject
 $uid
 $organizername
 $organizeremail
 $location
 $endtime
 $recurrence
 $sensitivity
 $busystatus
 $alldayevent
 $reminder
 $rtf
 $meetingstatus
 $attendees
 $body
 $bodytruncated
 $exception
 $deleted
 $exceptionstarttime
 $categories
 $asbody
 $nativebodytype
 $disallownewtimeprop
 $responsetype
 $responserequested
const STREAMER_CHECKS = 6
const STREAMER_CHECK_REQUIRED = 7
const STREAMER_CHECK_ZEROORONE = 8
const STREAMER_CHECK_NOTALLOWED = 9
const STREAMER_CHECK_ONEVALUEOF = 10
const STREAMER_CHECK_SETZERO = "setToValue0"
const STREAMER_CHECK_SETONE = "setToValue1"
const STREAMER_CHECK_SETTWO = "setToValue2"
const STREAMER_CHECK_SETEMPTY = "setToValueEmpty"
const STREAMER_CHECK_CMPLOWER = 13
const STREAMER_CHECK_CMPHIGHER = 14
const STREAMER_CHECK_LENGTHMAX = 15
const STREAMER_CHECK_EMAIL = 16
const STREAMER_VAR = 1
const STREAMER_ARRAY = 2
const STREAMER_TYPE = 3
const STREAMER_PROP = 4
const STREAMER_TYPE_DATE = 1
const STREAMER_TYPE_HEX = 2
const STREAMER_TYPE_DATE_DASHES = 3
const STREAMER_TYPE_STREAM = 4
const STREAMER_TYPE_IGNORE = 5
const STREAMER_TYPE_SEND_EMPTY = 6
const STREAMER_TYPE_NO_CONTAINER = 7
const STREAMER_TYPE_COMMA_SEPARATED = 8
const STREAMER_TYPE_SEMICOLON_SEPARATED = 9
 $flags
 $content

Protected Attributes

 $unsetVars
 $mapping

Detailed Description

Definition at line 49 of file syncappointment.php.


Member Function Documentation

SyncObject::__toString ( ) [inherited]

String representation of the object.

Returns:
String

Definition at line 161 of file syncobject.php.

                                 {
        $str = get_class($this) . " (\n";

        $streamerVars = array();
        foreach ($this->mapping as $k=>$v)
            $streamerVars[$v[self::STREAMER_VAR]] = (isset($v[self::STREAMER_TYPE]))?$v[self::STREAMER_TYPE]:false;

        foreach (get_object_vars($this) as $k=>$v) {
            if ($k == "mapping") continue;

            if (array_key_exists($k, $streamerVars))
                $strV = "(S) ";
            else
                $strV = "";

            // self::STREAMER_ARRAY ?
            if (is_array($v)) {
                $str .= "\t". $strV . $k ."(Array) size: " . count($v) ."\n";
                foreach ($v as $value) $str .= "\t\t". Utils::PrintAsString($value) ."\n";
            }
            else if ($v instanceof SyncObject) {
                $str .= "\t". $strV .$k ." => ". str_replace("\n", "\n\t\t\t", $v->__toString()) . "\n";
            }
            else
                $str .= "\t". $strV .$k ." => " . (isset($this->$k)? Utils::PrintAsString($this->$k) :"null") . "\n";
        }
        $str .= ")";

        return $str;
    }

Here is the call graph for this function:

SyncAppointment::Check ( logAsDebug = false)

Method checks if the object has the minimum of required parameters and fullfills semantic dependencies.

This overloads the general check() with special checks to be executed Checks if SYNC_POOMCAL_ORGANIZERNAME and SYNC_POOMCAL_ORGANIZEREMAIL are correctly set

Parameters:
boolean$logAsDebug(opt) default is false, so messages are logged in WARN log level

public

Returns:
boolean

Reimplemented from SyncObject.

Definition at line 196 of file syncappointment.php.

                                               {
        $ret = parent::Check($logAsDebug);
        if (!$ret)
            return false;

        if ($this->meetingstatus > 0) {
            if (!isset($this->organizername) || !isset($this->organizeremail)) {
                ZLog::Write(LOGLEVEL_WARN, "SyncAppointment->Check(): Parameter 'organizername' and 'organizeremail' should be set for a meeting request");
            }
        }

        // do not sync a recurrent appointment without a timezone
        if (isset($this->recurrence) && !isset($this->timezone)) {
            ZLog::Write(LOGLEVEL_ERROR, "SyncAppointment->Check(): timezone for a recurring appointment is not set.");
            return false;
        }

        return true;
    }

Here is the call graph for this function:

Streamer::Decode ( &$  decoder) [inherited]

Decodes the WBXML from a WBXMLdecoder until we reach the same depth level of WBXML.

This means that if there are multiple objects at this level, then only the first is decoded SubOjects are auto-instantiated and decoded using the same functionality

Parameters:
WBXMLDecoder$decoderpublic

Definition at line 89 of file streamer.php.

                                      {
        while(1) {
            $entity = $decoder->getElement();

            if($entity[EN_TYPE] == EN_TYPE_STARTTAG) {
                if(! ($entity[EN_FLAGS] & EN_FLAGS_CONTENT)) {
                    $map = $this->mapping[$entity[EN_TAG]];
                    if (isset($map[self::STREAMER_ARRAY])) {
                        $this->$map[self::STREAMER_VAR] = array();
                    } else if(!isset($map[self::STREAMER_TYPE])) {
                        $this->$map[self::STREAMER_VAR] = "";
                    }
                    else if ($map[self::STREAMER_TYPE] == self::STREAMER_TYPE_DATE || $map[self::STREAMER_TYPE] == self::STREAMER_TYPE_DATE_DASHES ) {
                        $this->$map[self::STREAMER_VAR] = "";
                    }
                    else if ($map[self::STREAMER_TYPE] == self::STREAMER_TYPE_SEND_EMPTY)
                        $this->$map[self::STREAMER_VAR] = "";
                    else if (isset($map[self::STREAMER_PROP]) && $map[self::STREAMER_PROP] == self::STREAMER_TYPE_SEND_EMPTY)
                        $this->$map[self::STREAMER_VAR] = "";
                    continue;
                }
                // Found a start tag
                if(!isset($this->mapping[$entity[EN_TAG]])) {
                    // This tag shouldn't be here, abort
                    ZLog::Write(LOGLEVEL_WBXMLSTACK, sprintf("Tag '%s' unexpected in type XML type '%s'", $entity[EN_TAG], get_class($this)));
                    return false;
                }
                else {
                    $map = $this->mapping[$entity[EN_TAG]];

                    // Handle an array
                    if(isset($map[self::STREAMER_ARRAY])) {
                        while(1) {
                            //do not get start tag for an array without a container
                            if (!(isset($map[self::STREAMER_PROP]) && $map[self::STREAMER_PROP] == self::STREAMER_TYPE_NO_CONTAINER)) {
                                if(!$decoder->getElementStartTag($map[self::STREAMER_ARRAY]))
                                    break;
                            }
                            if(isset($map[self::STREAMER_TYPE])) {
                                $decoded = new $map[self::STREAMER_TYPE];

                                $decoded->Decode($decoder);
                            }
                            else {
                                $decoded = $decoder->getElementContent();
                            }

                            if(!isset($this->$map[self::STREAMER_VAR]))
                                $this->$map[self::STREAMER_VAR] = array($decoded);
                            else
                                array_push($this->$map[self::STREAMER_VAR], $decoded);

                            if(!$decoder->getElementEndTag()) //end tag of a container element
                                return false;

                            if (isset($map[self::STREAMER_PROP]) && $map[self::STREAMER_PROP] == self::STREAMER_TYPE_NO_CONTAINER) {
                                $e = $decoder->peek();
                                //go back to the initial while if another block of no container elements is found
                                if ($e[EN_TYPE] == EN_TYPE_STARTTAG) {
                                    continue 2;
                                }
                                //break on end tag because no container elements block end is reached
                                if ($e[EN_TYPE] == EN_TYPE_ENDTAG)
                                    break;
                                if (empty($e))
                                    break;
                            }
                        }
                        //do not get end tag for an array without a container
                        if (!(isset($map[self::STREAMER_PROP]) && $map[self::STREAMER_PROP] == self::STREAMER_TYPE_NO_CONTAINER)) {
                            if(!$decoder->getElementEndTag()) //end tag of container
                                return false;
                        }
                    }
                    else { // Handle single value
                        if(isset($map[self::STREAMER_TYPE])) {
                            // Complex type, decode recursively
                            if($map[self::STREAMER_TYPE] == self::STREAMER_TYPE_DATE || $map[self::STREAMER_TYPE] == self::STREAMER_TYPE_DATE_DASHES) {
                                $decoded = $this->parseDate($decoder->getElementContent());
                                if(!$decoder->getElementEndTag())
                                    return false;
                            }
                            else if($map[self::STREAMER_TYPE] == self::STREAMER_TYPE_HEX) {
                                $decoded = hex2bin($decoder->getElementContent());
                                if(!$decoder->getElementEndTag())
                                    return false;
                            }
                            else if($map[self::STREAMER_TYPE] == self::STREAMER_TYPE_SEND_EMPTY) {
                                $decoded = $decoder->getElementContent();
                                if(!$decoder->getElementEndTag())
                                    return false;
                            }
                            else {
                                $subdecoder = new $map[self::STREAMER_TYPE]();
                                if($subdecoder->Decode($decoder) === false)
                                    return false;

                                $decoded = $subdecoder;

                                if(!$decoder->getElementEndTag()) {
                                    ZLog::Write(LOGLEVEL_WBXMLSTACK, sprintf("No end tag for '%s'", $entity[EN_TAG]));
                                    return false;
                                }
                            }
                        }
                        else {
                            // Simple type, just get content
                            $decoded = $decoder->getElementContent();

                            if($decoded === false) {
                                // the tag is declared to have content, but no content is available.
                                // set an empty content
                                $decoded = "";
                            }

                            if(!$decoder->getElementEndTag()) {
                                ZLog::Write(LOGLEVEL_WBXMLSTACK, sprintf("Unable to get end tag for '%s'", $entity[EN_TAG]));
                                return false;
                            }
                        }
                        // $decoded now contains data object (or string)
                        $this->$map[self::STREAMER_VAR] = $decoded;
                    }
                }
            }
            else if($entity[EN_TYPE] == EN_TYPE_ENDTAG) {
                $decoder->ungetElement($entity);
                break;
            }
            else {
                ZLog::Write(LOGLEVEL_WBXMLSTACK, "Unexpected content in type");
                break;
            }
        }
    }

Here is the call graph for this function:

SyncObject::emptySupported ( supportedFields) [inherited]

Sets all supported but not transmitted variables of this SyncObject to an "empty" value, so they are deleted when being saved.

Parameters:
array$supportedFieldsarray with all supported fields, if available

public

Returns:
boolean

Definition at line 82 of file syncobject.php.

                                                     {
        if ($supportedFields === false || !is_array($supportedFields))
            return false;

        foreach ($supportedFields as $field) {
            if (!isset($this->mapping[$field])) {
                ZLog::Write(LOGLEVEL_WARN, sprintf("Field '%s' is supposed to be emptied but is not defined for '%s'", $field, get_class($this)));
                continue;
            }
            $var = $this->mapping[$field][self::STREAMER_VAR];
            // add var to $this->unsetVars if $var is not set
            if (!isset($this->$var))
                $this->unsetVars[] = $var;
        }
        ZLog::Write(LOGLEVEL_DEBUG, sprintf("Supported variables to be unset: %s", implode(',', $this->unsetVars)));
        return true;
    }

Here is the call graph for this function:

Streamer::Encode ( &$  encoder) [inherited]

Encodes this object and any subobjects - output is ordered according to mapping.

Parameters:
WBXMLEncoder$encoderpublic

Definition at line 232 of file streamer.php.

                                      {
        foreach($this->mapping as $tag => $map) {
            if(isset($this->$map[self::STREAMER_VAR])) {
                // Variable is available
                if(is_object($this->$map[self::STREAMER_VAR])) {
                    // Subobjects can do their own encoding
                    if ($this->$map[self::STREAMER_VAR] instanceof Streamer) {
                        $encoder->startTag($tag);
                        $this->$map[self::STREAMER_VAR]->Encode($encoder);
                        $encoder->endTag();
                    }
                    else
                        ZLog::Write(LOGLEVEL_ERROR, sprintf("Streamer->Encode(): parameter '%s' of object %s is not of type Streamer", $map[self::STREAMER_VAR], get_class($this)));
                }
                // Array of objects
                else if(isset($map[self::STREAMER_ARRAY])) {
                    if ((empty($this->$map[self::STREAMER_VAR]) && isset($map[self::STREAMER_TYPE]) && $map[self::STREAMER_TYPE] == self::STREAMER_TYPE_SEND_EMPTY)
                    || (isset($map[self::STREAMER_PROP]) &&  isset($map[self::STREAMER_PROP]) == self::STREAMER_TYPE_SEND_EMPTY)) {
                        $encoder->startTag($tag, false, true);
                    }
                    else {
                        // Outputs array container (eg Attachments)
                        // Do not output start and end tag when type is STREAMER_TYPE_NO_CONTAINER
                        if (!isset($map[self::STREAMER_PROP]) || $map[self::STREAMER_PROP] != self::STREAMER_TYPE_NO_CONTAINER)
                            $encoder->startTag($tag);

                        foreach ($this->$map[self::STREAMER_VAR] as $element) {
                            if(is_object($element)) {
                                $encoder->startTag($map[self::STREAMER_ARRAY]); // Outputs object container (eg Attachment)
                                $element->Encode($encoder);
                                $encoder->endTag();
                            }
                            else {
                                if(strlen($element) == 0)
                                      // Do not output empty items. Not sure if we should output an empty tag with $encoder->startTag($map[self::STREAMER_ARRAY], false, true);
                                      ;
                                else {
                                    $encoder->startTag($map[self::STREAMER_ARRAY]);
                                    $encoder->content($element);
                                    $encoder->endTag();
                                }
                            }
                        }

                        if  (!isset($map[self::STREAMER_PROP]) || $map[self::STREAMER_PROP] != self::STREAMER_TYPE_NO_CONTAINER)
                            $encoder->endTag();
                    }
                }
                else {
                    if(isset($map[self::STREAMER_TYPE]) && $map[self::STREAMER_TYPE] == self::STREAMER_TYPE_IGNORE) {
                        continue;
                    }

                    // Simple type
                    if(!isset($map[self::STREAMER_TYPE]) && strlen($this->$map[self::STREAMER_VAR]) == 0) {
                        if ((isset($map[self::STREAMER_TYPE]) && $map[self::STREAMER_TYPE] == self::STREAMER_TYPE_SEND_EMPTY)
                        || (isset($map[self::STREAMER_PROP]) &&  isset($map[self::STREAMER_PROP]) == self::STREAMER_TYPE_SEND_EMPTY)) {
                            $encoder->startTag($tag, false, true);
                        }
                          // Do not output empty items. See above: $encoder->startTag($tag, false, true);
                        continue;
                    } else
                        $encoder->startTag($tag);

                    if(isset($map[self::STREAMER_TYPE]) && ($map[self::STREAMER_TYPE] == self::STREAMER_TYPE_DATE || $map[self::STREAMER_TYPE] == self::STREAMER_TYPE_DATE_DASHES)) {
                        if($this->$map[self::STREAMER_VAR] != 0) // don't output 1-1-1970
                            $encoder->content($this->formatDate($this->$map[self::STREAMER_VAR], $map[self::STREAMER_TYPE]));
                    }
                    else if(isset($map[self::STREAMER_TYPE]) && $map[self::STREAMER_TYPE] == self::STREAMER_TYPE_HEX) {
                        $encoder->content(strtoupper(bin2hex($this->$map[self::STREAMER_VAR])));
                    }
                    else if(isset($map[self::STREAMER_TYPE]) && $map[self::STREAMER_TYPE] == self::STREAMER_TYPE_STREAM) {
                        //encode stream with base64
                        //TODO stream chunked without loading the complete attachment into memory
                        $stream = $this->$map[self::STREAMER_VAR];
                        $base64filter = stream_filter_append($stream, 'convert.base64-encode');
                        $d = "";
                        while (!feof($stream)) {
                            $d .= fgets($stream, 4096);
                        }
                        $encoder->content($d);
                        stream_filter_remove($base64filter);
                    }
                    // implode comma or semicolon arrays into a string
                    else if(isset($map[self::STREAMER_TYPE]) && is_array($this->$map[self::STREAMER_VAR]) &&
                        ($map[self::STREAMER_TYPE] == self::STREAMER_TYPE_COMMA_SEPARATED || $map[self::STREAMER_TYPE] == self::STREAMER_TYPE_SEMICOLON_SEPARATED)) {
                        $glue = ($map[self::STREAMER_TYPE] == self::STREAMER_TYPE_COMMA_SEPARATED)?", ":"; ";
                        $encoder->content(implode($glue, $this->$map[self::STREAMER_VAR]));
                    }
                    else {
                        $encoder->content($this->$map[self::STREAMER_VAR]);
                    }
                    $encoder->endTag();
                }
            }
        }
        // Output our own content
        if(isset($this->content))
            $encoder->content($this->content);
    }

Here is the call graph for this function:

SyncObject::equals ( odo,
log = false 
) [inherited]

Compares this a SyncObject to another.

In case that all available mapped fields are exactly EQUAL, it returns true

See also:
SyncObject
Parameters:
SyncObject$odoother SyncObject
Returns:
boolean

Definition at line 109 of file syncobject.php.

                                               {
        if ($odo === false)
            return false;

        // check objecttype
        if (! ($odo instanceof SyncObject)) {
            ZLog::Write(LOGLEVEL_DEBUG, "SyncObject->equals() the target object is not a SyncObject");
            return false;
        }

        // check for mapped fields
        foreach ($this->mapping as $v) {
            $val = $v[self::STREAMER_VAR];
            // array of values?
            if (isset($v[self::STREAMER_ARRAY])) {
                // seek for differences in the arrays
                if (is_array($this->$val) && is_array($odo->$val)) {
                    if (count(array_diff($this->$val, $odo->$val)) + count(array_diff($odo->$val, $this->$val)) > 0) {
                        ZLog::Write(LOGLEVEL_DEBUG, sprintf("SyncObject->equals() items in array '%s' differ", $val));
                        return false;
                    }
                }
                else {
                    ZLog::Write(LOGLEVEL_DEBUG, sprintf("SyncObject->equals() array '%s' is set in one but not the other object", $val));
                    return false;
                }
            }
            else {
                if (isset($this->$val) && isset($odo->$val)) {
                    if ($this->$val != $odo->$val){
                        ZLog::Write(LOGLEVEL_DEBUG, sprintf("SyncObject->equals() false on field '%s': '%s' != '%s'", $val, Utils::PrintAsString($this->$val), Utils::PrintAsString($odo->$val)));
                        return false;
                    }
                }
                else if (!isset($this->$val) && !isset($odo->$val)) {
                    continue;
                }
                else {
                    ZLog::Write(LOGLEVEL_DEBUG, sprintf("SyncObject->equals() false because field '%s' is only defined at one obj: '%s' != '%s'", $val, Utils::PrintAsString(isset($this->$val)), Utils::PrintAsString(isset($odo->$val))));
                    return false;
                }
            }
        }

        return true;
    }

Here is the call graph for this function:

SyncObject::getUnsetVars ( ) [inherited]

Returns the properties which have to be unset on the server.

public

Returns:
array

Definition at line 198 of file syncobject.php.

                                   {
        return $this->unsetVars;
    }
Streamer::parseDate ( ts) [inherited]

Transforms an AS timestamp into a unix timestamp.

Parameters:
string$tsprivate
Returns:
long

Definition at line 423 of file streamer.php.

                            {
        if(preg_match("/(\d{4})[^0-9]*(\d{2})[^0-9]*(\d{2})(T(\d{2})[^0-9]*(\d{2})[^0-9]*(\d{2})(.\d+)?Z){0,1}$/", $ts, $matches)) {
            if ($matches[1] >= 2038){
                $matches[1] = 2038;
                $matches[2] = 1;
                $matches[3] = 18;
                $matches[5] = $matches[6] = $matches[7] = 0;
            }

            if (!isset($matches[5])) $matches[5] = 0;
            if (!isset($matches[6])) $matches[6] = 0;
            if (!isset($matches[7])) $matches[7] = 0;

            return gmmktime($matches[5], $matches[6], $matches[7], $matches[2], $matches[3], $matches[1]);
        }
        return 0;
    }

Here is the caller graph for this function:

Streamer::serialize ( ) [inherited]

Method to serialize a Streamer and respective SyncObject.

public

Returns:
array

Definition at line 365 of file streamer.php.

                                {
        $values = array();
        foreach ($this->mapping as $k=>$v) {
            if (isset($this->$v[self::STREAMER_VAR]))
                $values[$v[self::STREAMER_VAR]] = serialize($this->$v[self::STREAMER_VAR]);
        }

        return serialize($values);
    }
Streamer::Streamer ( mapping) [inherited]

Constructor.

Parameters:
array$mappinginternal mapping of variables public

Definition at line 75 of file streamer.php.

                                {
        $this->mapping = $mapping;
        $this->flags = false;
    }

Here is the caller graph for this function:

Streamer::StripData ( ) [inherited]

Removes not necessary data from the object.

public

Returns:
boolean

Definition at line 339 of file streamer.php.

                                {
        foreach ($this->mapping as $k=>$v) {
            if (isset($this->$v[self::STREAMER_VAR])) {
                if (is_object($this->$v[self::STREAMER_VAR]) && method_exists($this->$v[self::STREAMER_VAR], "StripData") ) {
                    $this->$v[self::STREAMER_VAR]->StripData();
                }
                else if (isset($v[self::STREAMER_ARRAY]) && !empty($this->$v[self::STREAMER_VAR])) {
                    foreach ($this->$v[self::STREAMER_VAR] as $element) {
                        if (is_object($element) && method_exists($element, "StripData") ) {
                            $element->StripData();
                        }
                    }
                }
            }
        }
        unset($this->mapping);

        return true;
    }

Definition at line 84 of file syncappointment.php.

                               {
        $mapping = array(
                    SYNC_POOMCAL_TIMEZONE                               => array (  self::STREAMER_VAR      => "timezone"),

                    SYNC_POOMCAL_DTSTAMP                                => array (  self::STREAMER_VAR      => "dtstamp",
                                                                                    self::STREAMER_TYPE     => self::STREAMER_TYPE_DATE,
                                                                                    self::STREAMER_CHECKS   => array(   self::STREAMER_CHECK_REQUIRED       => self::STREAMER_CHECK_SETZERO)),

                    SYNC_POOMCAL_STARTTIME                              => array (  self::STREAMER_VAR      => "starttime",
                                                                                    self::STREAMER_TYPE     => self::STREAMER_TYPE_DATE,
                                                                                    self::STREAMER_CHECKS   => array(   self::STREAMER_CHECK_REQUIRED       => self::STREAMER_CHECK_SETZERO,
                                                                                                                        self::STREAMER_CHECK_CMPLOWER       => SYNC_POOMCAL_ENDTIME ) ),


                    SYNC_POOMCAL_SUBJECT                                => array (  self::STREAMER_VAR      => "subject",
                                                                                    self::STREAMER_CHECKS   => array(   self::STREAMER_CHECK_REQUIRED       => self::STREAMER_CHECK_SETEMPTY)),

                    SYNC_POOMCAL_UID                                    => array (  self::STREAMER_VAR      => "uid"),
                    SYNC_POOMCAL_ORGANIZERNAME                          => array (  self::STREAMER_VAR      => "organizername"), // verified below
                    SYNC_POOMCAL_ORGANIZEREMAIL                         => array (  self::STREAMER_VAR      => "organizeremail"), // verified below
                    SYNC_POOMCAL_LOCATION                               => array (  self::STREAMER_VAR      => "location"),
                    SYNC_POOMCAL_ENDTIME                                => array (  self::STREAMER_VAR      => "endtime",
                                                                                    self::STREAMER_TYPE     => self::STREAMER_TYPE_DATE,
                                                                                    self::STREAMER_CHECKS   => array(   self::STREAMER_CHECK_REQUIRED       => self::STREAMER_CHECK_SETONE,
                                                                                                                        self::STREAMER_CHECK_CMPHIGHER      => SYNC_POOMCAL_STARTTIME ) ),

                    SYNC_POOMCAL_RECURRENCE                             => array (  self::STREAMER_VAR      => "recurrence",
                                                                                    self::STREAMER_TYPE     => "SyncRecurrence"),

                    // Sensitivity values
                    // 0 = Normal
                    // 1 = Personal
                    // 2 = Private
                    // 3 = Confident
                    SYNC_POOMCAL_SENSITIVITY                            => array (  self::STREAMER_VAR      => "sensitivity",
                                                                                    self::STREAMER_CHECKS   => array(   self::STREAMER_CHECK_ONEVALUEOF => array(0,1,2,3) )),

                    // Busystatus values
                    // 0 = Free
                    // 1 = Tentative
                    // 2 = Busy
                    // 3 = Out of office
                    SYNC_POOMCAL_BUSYSTATUS                             => array (  self::STREAMER_VAR      => "busystatus",
                                                                                    self::STREAMER_CHECKS   => array(   self::STREAMER_CHECK_REQUIRED   => self::STREAMER_CHECK_SETTWO,
                                                                                                                        self::STREAMER_CHECK_ONEVALUEOF => array(0,1,2,3) )),

                    SYNC_POOMCAL_ALLDAYEVENT                            => array (  self::STREAMER_VAR      => "alldayevent",
                                                                                    self::STREAMER_CHECKS   => array(   self::STREAMER_CHECK_ZEROORONE      => self::STREAMER_CHECK_SETZERO)),

                    SYNC_POOMCAL_REMINDER                               => array (  self::STREAMER_VAR      => "reminder",
                                                                                    self::STREAMER_CHECKS   => array(   self::STREAMER_CHECK_CMPHIGHER      => -1)),

                    SYNC_POOMCAL_RTF                                    => array (  self::STREAMER_VAR      => "rtf"),

                    // Meetingstatus values
                    //  0 = is not a meeting
                    //  1 = is a meeting
                    //  3 = Meeting received
                    //  5 = Meeting is canceled
                    //  7 = Meeting is canceled and received
                    //  9 = as 1
                    // 11 = as 3
                    // 13 = as 5
                    // 15 = as 7
                    SYNC_POOMCAL_MEETINGSTATUS                          => array (  self::STREAMER_VAR      => "meetingstatus",
                                                                                    self::STREAMER_CHECKS   => array(   self::STREAMER_CHECK_ONEVALUEOF => array(0,1,3,5,7,9,11,13,15) )),

                    SYNC_POOMCAL_ATTENDEES                              => array (  self::STREAMER_VAR      => "attendees",
                                                                                    self::STREAMER_TYPE     => "SyncAttendee",
                                                                                    self::STREAMER_ARRAY    => SYNC_POOMCAL_ATTENDEE),

                    SYNC_POOMCAL_BODY                                   => array (  self::STREAMER_VAR      => "body"),
                    SYNC_POOMCAL_BODYTRUNCATED                          => array (  self::STREAMER_VAR      => "bodytruncated"),
                    SYNC_POOMCAL_EXCEPTIONS                             => array (  self::STREAMER_VAR      => "exceptions",
                                                                                    self::STREAMER_TYPE     => "SyncAppointmentException",
                                                                                    self::STREAMER_ARRAY    => SYNC_POOMCAL_EXCEPTION),

                    SYNC_POOMCAL_CATEGORIES                             => array (  self::STREAMER_VAR      => "categories",
                                                                                    self::STREAMER_ARRAY    => SYNC_POOMCAL_CATEGORY),
                );

        if (Request::GetProtocolVersion() >= 12.0) {
            $mapping[SYNC_AIRSYNCBASE_BODY]                             = array (   self::STREAMER_VAR      => "asbody",
                                                                                    self::STREAMER_TYPE     => "SyncBaseBody");

            $mapping[SYNC_AIRSYNCBASE_NATIVEBODYTYPE]                   = array (   self::STREAMER_VAR      => "nativebodytype");

            //unset these properties because airsyncbase body and attachments will be used instead
            unset($mapping[SYNC_POOMCAL_BODY], $mapping[SYNC_POOMCAL_BODYTRUNCATED]);
        }

        if(Request::GetProtocolVersion() >= 14.0) {
            $mapping[SYNC_POOMCAL_DISALLOWNEWTIMEPROPOSAL]              = array (   self::STREAMER_VAR      => "disallownewtimeprop");
            $mapping[SYNC_POOMCAL_RESPONSEREQUESTED]                    = array (   self::STREAMER_VAR      => "responserequested");
            $mapping[SYNC_POOMCAL_RESPONSETYPE]                         = array (   self::STREAMER_VAR      => "responsetype");
        }

        parent::SyncObject($mapping);
    }

Here is the call graph for this function:

Here is the caller graph for this function:

SyncObject::SyncObject ( mapping) [inherited]

Definition at line 68 of file syncobject.php.

                                         {
        $this->unsetVars = array();
        parent::Streamer($mapping);
    }

Here is the call graph for this function:

Here is the caller graph for this function:

Streamer::unserialize ( data) [inherited]

Method to unserialize a Streamer and respective SyncObject.

public

Returns:
array

Definition at line 381 of file streamer.php.

                                       {
        $class = get_class($this);
        $this->$class();
        $values = unserialize($data);
        foreach ($values as $k=>$v)
            $this->$k = unserialize($v);

        return true;
    }

Member Data Documentation

Definition at line 62 of file syncappointment.php.

Definition at line 75 of file syncappointment.php.

Definition at line 66 of file syncappointment.php.

Definition at line 67 of file syncappointment.php.

Definition at line 68 of file syncappointment.php.

Definition at line 61 of file syncappointment.php.

Definition at line 72 of file syncappointment.php.

Streamer::$content [inherited]

Definition at line 67 of file streamer.php.

Reimplemented in SyncAppointmentException.

Definition at line 70 of file syncappointment.php.

Definition at line 79 of file syncappointment.php.

Definition at line 51 of file syncappointment.php.

Definition at line 58 of file syncappointment.php.

Definition at line 69 of file syncappointment.php.

Reimplemented in SyncAppointmentException.

Definition at line 71 of file syncappointment.php.

Streamer::$flags [inherited]

Definition at line 66 of file streamer.php.

Definition at line 57 of file syncappointment.php.

Streamer::$mapping [protected, inherited]

Definition at line 65 of file streamer.php.

Definition at line 65 of file syncappointment.php.

Definition at line 76 of file syncappointment.php.

Definition at line 56 of file syncappointment.php.

Definition at line 55 of file syncappointment.php.

Definition at line 59 of file syncappointment.php.

Definition at line 63 of file syncappointment.php.

Definition at line 81 of file syncappointment.php.

Definition at line 80 of file syncappointment.php.

Definition at line 64 of file syncappointment.php.

Definition at line 60 of file syncappointment.php.

Definition at line 52 of file syncappointment.php.

Definition at line 53 of file syncappointment.php.

Definition at line 50 of file syncappointment.php.

Definition at line 54 of file syncappointment.php.

SyncObject::$unsetVars [protected, inherited]

Definition at line 65 of file syncobject.php.

const Streamer::STREAMER_ARRAY = 2 [inherited]

Definition at line 52 of file streamer.php.

const SyncObject::STREAMER_CHECK_CMPHIGHER = 14 [inherited]

Definition at line 61 of file syncobject.php.

const SyncObject::STREAMER_CHECK_CMPLOWER = 13 [inherited]

Definition at line 60 of file syncobject.php.

const SyncObject::STREAMER_CHECK_EMAIL = 16 [inherited]

Definition at line 63 of file syncobject.php.

const SyncObject::STREAMER_CHECK_LENGTHMAX = 15 [inherited]

Definition at line 62 of file syncobject.php.

Definition at line 54 of file syncobject.php.

const SyncObject::STREAMER_CHECK_ONEVALUEOF = 10 [inherited]

Definition at line 55 of file syncobject.php.

const SyncObject::STREAMER_CHECK_REQUIRED = 7 [inherited]

Definition at line 52 of file syncobject.php.

const SyncObject::STREAMER_CHECK_SETEMPTY = "setToValueEmpty" [inherited]

Definition at line 59 of file syncobject.php.

const SyncObject::STREAMER_CHECK_SETONE = "setToValue1" [inherited]

Definition at line 57 of file syncobject.php.

const SyncObject::STREAMER_CHECK_SETTWO = "setToValue2" [inherited]

Definition at line 58 of file syncobject.php.

const SyncObject::STREAMER_CHECK_SETZERO = "setToValue0" [inherited]

Definition at line 56 of file syncobject.php.

const SyncObject::STREAMER_CHECK_ZEROORONE = 8 [inherited]

Definition at line 53 of file syncobject.php.

const SyncObject::STREAMER_CHECKS = 6 [inherited]

Definition at line 51 of file syncobject.php.

const Streamer::STREAMER_PROP = 4 [inherited]

Definition at line 54 of file streamer.php.

const Streamer::STREAMER_TYPE = 3 [inherited]

Definition at line 53 of file streamer.php.

Definition at line 62 of file streamer.php.

const Streamer::STREAMER_TYPE_DATE = 1 [inherited]

Definition at line 55 of file streamer.php.

const Streamer::STREAMER_TYPE_DATE_DASHES = 3 [inherited]

Definition at line 57 of file streamer.php.

const Streamer::STREAMER_TYPE_HEX = 2 [inherited]

Definition at line 56 of file streamer.php.

const Streamer::STREAMER_TYPE_IGNORE = 5 [inherited]

Definition at line 59 of file streamer.php.

const Streamer::STREAMER_TYPE_NO_CONTAINER = 7 [inherited]

Definition at line 61 of file streamer.php.

Definition at line 63 of file streamer.php.

const Streamer::STREAMER_TYPE_SEND_EMPTY = 6 [inherited]

Definition at line 60 of file streamer.php.

const Streamer::STREAMER_TYPE_STREAM = 4 [inherited]

Definition at line 58 of file streamer.php.

const Streamer::STREAMER_VAR = 1 [inherited]

Definition at line 51 of file streamer.php.


The documentation for this class was generated from the following file: