Skip to content

Commit

Permalink
Cache and allow overriding value of clientType.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Sep 26, 2014
1 parent 60d8905 commit f8ff845
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions framework/ActiveSync/lib/Horde/ActiveSync/Device.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ class Horde_ActiveSync_Device
*/
protected $_multiplexSet = false;

/**
* Local override/cache of detected clientType.
*
* @var string
*/
protected $_clientType;

/**
* Const'r
*
Expand Down Expand Up @@ -131,8 +138,10 @@ public function &__get($property)
case self::BLOCKED:
return $this->_properties['properties'][$property];
case 'clientType':
$type = $this->_getClientType();
return $type;
if (!isset($this->_clientType)) {
$this->_clientType = $this->_getClientType();
}
return $this->_clientType;
case self::VERSION:
if (isset($this->_properties['properties'][self::VERSION])) {
return $this->_properties['properties'][self::VERSION];
Expand Down Expand Up @@ -173,6 +182,9 @@ public function __set($property, $value)
$properties[$property] = $value;
$this->setDeviceProperties($properties);
break;
case 'clientType':
$this->_clientType = $value;
break;
default:
if (!isset($this->_properties[$property]) || $value != $this->_properties[$property]) {
$this->_dirty[$property] = true;
Expand Down

0 comments on commit f8ff845

Please sign in to comment.