Beispiel #1
0
 public function __set($key, $value)
 {
     // Only packages
     if (!$value instanceof Engine_Package_Manifest) {
         throw new Engine_Package_Manager_Exception('Cannot assign a non-package');
     }
     // Ignore the key
     $guid = $value->getGuid();
     $key = $value->getKey();
     if (!$this->__isset($key) && isset($this->_indexByGuid[$guid])) {
         //$tmpValue = $this->__get($key);
         //if( $tmpValue->getKey() != $value->getKey() ) {
         if ($key != $this->_indexByGuid[$guid]) {
             throw new Engine_Package_Manager_Exception('Does not support multiple versions of the same package');
         }
     }
     $this->_indexByGuid[$guid] = $key;
     parent::__set($key, $value);
 }
Beispiel #2
0
 public function __set($key, $value)
 {
     // Only operations
     if (!$value instanceof Engine_Package_Manager_Operation_Abstract) {
         throw new Engine_Package_Manager_Exception('Problem loading operation from cache');
     }
     // Ignore the key
     $guid = $value->getGuid();
     $key = $value->getKey();
     if (!$this->__isset($key) && isset($this->_indexByGuid[$guid])) {
         $tmpValue = $this->__get($key);
         if ($tmpValue->getKey() != $value->getKey()) {
             throw new Engine_Package_Manager_Exception('Does not support multiple versions of the same package');
         }
     }
     $this->_indexByGuid[$guid] = $key;
     parent::__set($key, $value);
 }