Horde_ActiveSync_Message_Contact::isGhosted PHP Метод

isGhosted() публичный Метод

A property is ghosted if it is NOT listed in the SUPPORTED list sent by the client AND is NOT present in the request data.
public isGhosted ( string $property, array $options = [] ) : boolean
$property string The property to check
$options array An array of options: - ignoreEmptyPictureTagCheck: boolean If true, will not check for the QUIRK_INCORRECTLY_SENDS_EMPTY_PICTURE_TAG quirk. @since 2.32.0
Результат boolean
    public function isGhosted($property, $options = array())
    {
        // MS-ASCMD 2.2.3.168:
        // An empty SUPPORTED container indicates that ALL elements able to be
        // ghosted ARE ghosted. A *missing* SUPPORTED tag indicates that NO
        // fields are ghosted - any ghostable properties are always considered
        // NOT ghosted. Some clients like iOS 4.x screw this up by not sending
        // any SUPPORTED container and also not sending the picture field during
        // edits.
        if ($property == $this->_mapping[self::PICTURE][self::KEY_ATTRIBUTE]) {
            if (empty($options['ignoreEmptyPictureTagCheck']) && $this->_device->hasQuirk(Horde_ActiveSync_Device::QUIRK_INCORRECTLY_SENDS_EMPTY_PICTURE_TAG) && (!empty($this->_exists[$property]) && $this->{$property} == '' || empty($this->_exists[$property]))) {
                return true;
            }
            if (empty($this->_exists[$property]) && empty($this->_supported) && $this->_device->hasQuirk(Horde_ActiveSync_Device::QUIRK_NEEDS_SUPPORTED_PICTURE_TAG)) {
                return true;
            }
        }
        return parent::isGhosted($property);
    }

Usage Example

Пример #1
0
 public function testEmptySupportedTag()
 {
     $state = $this->getMockSkipConstructor('Horde_ActiveSync_State_Base');
     $fixture = array('userAgent' => 'Apple-iPad3C6/1202.435', 'properties' => array(Horde_ActiveSync_Device::OS => 'iOS 8.1.1'));
     $device = new Horde_ActiveSync_Device($state, $fixture);
     $contact = new Horde_ActiveSync_Message_Contact(array('device' => $device));
     $contact->setSupported(array(Horde_ActiveSync::ALL_GHOSTED));
     $this->assertEquals(true, $contact->isGhosted('fileas'));
 }
All Usage Examples Of Horde_ActiveSync_Message_Contact::isGhosted