Back to index

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

List of all members.

Public Member Functions

 __call ($name, $arguments)
 Expected magic getters and setters.
 BodyPreference ($type)
 Instantiates/returns the bodypreference object for a type.
 GetBodyPreference ()
 Returns available body preference objects.
 GetID ()
 Returns the unique id of that data object.
 GetDataArray ()
 Returns the internal array which contains all data of this object.
 SetDataArray ($data, $markAsChanged=false)
 Sets the internal array which contains all data of this object.
 IsDataChanged ()
 Indicates if the data contained in this object was modified.
 __set ($name, $value)
 PHP magic to set an instance variable.
 __get ($name)
 PHP magic to get an instance variable if the variable was not set previousely, the value of the Unsetdata array is returned.
 __isset ($name)
 PHP magic to check if an instance variable is set.
 __unset ($name)
 PHP magic to remove an instance variable.
 serialize ()
 Method to serialize a StateObject.
 unserialize ($data)
 Method to unserialize a StateObject.

Static Public Member Functions

static ThrowStateInvalidException ()
 Callback function for failed unserialize.

Protected Member Functions

 preSerialize ()
 Called before the StateObject is serialized.
 postUnserialize ()
 Called after the StateObject was unserialized.

Protected Attributes

 $unsetdata
 $data = array()
 $changed = false

Private Attributes

 $synckeyChanged = false

Detailed Description

Definition at line 46 of file contentparameters.php.


Member Function Documentation

ContentParameters::__call ( name,
arguments 
)

Expected magic getters and setters.

GetContentClass() + SetContentClass() GetConflict() + SetConflict() GetDeletesAsMoves() + SetDeletesAsMoves() GetFilterType() + SetFilterType() GetTruncation() + SetTruncation GetRTFTruncation() + SetRTFTruncation() GetMimeSupport () + SetMimeSupport() GetMimeTruncation() + SetMimeTruncation() GetConversationMode() + SetConversationMode() Overwrite StateObject->__call so we are able to handle ContentParameters->BodyPreference()

public

Returns:
mixed

Reimplemented from StateObject.

Definition at line 80 of file contentparameters.php.

                                              {
        if ($name === "BodyPreference")
            return $this->BodyPreference($arguments[0]);

        return parent::__call($name, $arguments);
    }

Here is the call graph for this function:

StateObject::__get ( name) [inherited]

PHP magic to get an instance variable if the variable was not set previousely, the value of the Unsetdata array is returned.

public

Returns:

Definition at line 120 of file stateobject.php.

                                 {
        $lname = strtolower($name);

        if (array_key_exists($lname, $this->data))
            return $this->data[$lname];

        if (isset($this->unsetdata) && is_array($this->unsetdata) && array_key_exists($lname, $this->unsetdata))
            return $this->unsetdata[$lname];

        return null;
    }
StateObject::__isset ( name) [inherited]

PHP magic to check if an instance variable is set.

public

Returns:

Definition at line 138 of file stateobject.php.

                                   {
        return isset($this->data[strtolower($name)]);
    }
StateObject::__set ( name,
value 
) [inherited]

PHP magic to set an instance variable.

public

Returns:

Definition at line 103 of file stateobject.php.

                                         {
        $lname = strtolower($name);
        if (isset($this->data[$lname]) && is_scalar($value) && !is_array($value) && $this->data[$lname] === $value)
            return false;

        $this->data[$lname] = $value;
        $this->changed = true;
    }
StateObject::__unset ( name) [inherited]

PHP magic to remove an instance variable.

public

Returns:

Definition at line 148 of file stateobject.php.

                                   {
        if (isset($this->$name)) {
            unset($this->data[strtolower($name)]);
            $this->changed = true;
        }
    }

Instantiates/returns the bodypreference object for a type.

Parameters:
int$typepublic
Returns:
int/boolean returns false if value is not defined

Definition at line 96 of file contentparameters.php.

                                          {
        if (!isset($this->bodypref))
            $this->bodypref = array();

        if (isset($this->bodypref[$type]))
            return $this->bodypref[$type];
        else {
            $asb = new BodyPreference();
            $arr = (array)$this->bodypref;
            $arr[$type] = $asb;
            $this->bodypref = $arr;
            return $asb;
        }
    }

Here is the caller graph for this function:

Returns available body preference objects.

public

Returns:
array/boolean returns false if the client's body preference is not available

Definition at line 117 of file contentparameters.php.

                                        {
        if (!isset($this->bodypref) || !(is_array($this->bodypref) || empty($this->bodypref))) {
            ZLog::Write(LOGLEVEL_DEBUG, sprintf("ContentParameters->GetBodyPreference(): bodypref is empty or not set"));
            return false;
        }
        return array_keys($this->bodypref);
    }

Here is the call graph for this function:

StateObject::GetDataArray ( ) [inherited]

Returns the internal array which contains all data of this object.

public

Returns:
array

Definition at line 69 of file stateobject.php.

                                   {
        return $this->data;
    }
StateObject::GetID ( ) [inherited]

Returns the unique id of that data object.

public

Returns:
array

Definition at line 56 of file stateobject.php.

                            {
        if (!isset($this->SO_internalid))
            $this->SO_internalid = sprintf('%04x%04x%04x', mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff));

        return $this->SO_internalid;
    }

Here is the caller graph for this function:

StateObject::IsDataChanged ( ) [inherited]

Indicates if the data contained in this object was modified.

public

Returns:
array

Definition at line 93 of file stateobject.php.

                                    {
        return $this->changed;
    }
StateObject::postUnserialize ( ) [protected, inherited]

Called after the StateObject was unserialized.

protected

Returns:
boolean

Reimplemented in SyncParameters.

Definition at line 253 of file stateobject.php.

                                         {
        return true;
    }

Here is the caller graph for this function:

Called before the StateObject is serialized.

protected

Returns:
boolean

Reimplemented from StateObject.

Definition at line 131 of file contentparameters.php.

                                      {
        parent::preSerialize();

        if ($this->changed === true && $this->synckeyChanged)
            $this->lastsynctime = time();

        return true;
    }
StateObject::serialize ( ) [inherited]

Method to serialize a StateObject.

public

Returns:
array

Definition at line 209 of file stateobject.php.

                                {
        // perform tasks just before serialization
        $this->preSerialize();

        return serialize(array($this->SO_internalid,$this->data));
    }

Here is the call graph for this function:

Here is the caller graph for this function:

StateObject::SetDataArray ( data,
markAsChanged = false 
) [inherited]

Sets the internal array which contains all data of this object.

Parameters:
array$datathe data to be written
boolean$markAsChanged(opt) indicates if the object should be marked as "changed", default false

public

Returns:
array

Definition at line 82 of file stateobject.php.

                                                                {
        $this->data = $data;
        $this->changed = $markAsChanged;
    }

Here is the caller graph for this function:

static StateObject::ThrowStateInvalidException ( ) [static, inherited]

Callback function for failed unserialize.

public

Exceptions:
StateInvalidException

Definition at line 263 of file stateobject.php.

                                                        {
        throw new StateInvalidException("Unserialization failed as class was not found or not compatible");
    }
StateObject::unserialize ( data) [inherited]

Method to unserialize a StateObject.

public

Returns:
array
Exceptions:
StateInvalidException

Definition at line 223 of file stateobject.php.

                                       {
        // throw a StateInvalidException if unserialize fails
        ini_set('unserialize_callback_func', 'StateObject::ThrowStateInvalidException');

        list($this->SO_internalid, $this->data) = unserialize($data);

        // perform tasks just after unserialization
        $this->postUnserialize();
        return true;
    }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

StateObject::$changed = false [protected, inherited]

Definition at line 48 of file stateobject.php.

StateObject::$data = array() [protected, inherited]

Definition at line 46 of file stateobject.php.

Definition at line 58 of file contentparameters.php.

Initial value:
 array(   'contentclass' => false,
                                    'foldertype' => '',
                                    'conflict' => false,
                                    'deletesasmoves' => true,
                                    'filtertype' => false,
                                    'truncation' => false,
                                    'rtftruncation' => false,
                                    'mimesupport' => false,
                                    'conversationmode' => false,
                                )

Reimplemented from StateObject.

Definition at line 47 of file contentparameters.php.


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