Exemple #1
0
 public function testSetFlagsFailure()
 {
     $properties = new ezcPersistentObjectProperties();
     try {
         $properties->setFlags(23);
         $this->fail('ezcBaseValueException not thrown on flags different to 0.');
     } catch (ezcBaseValueException $e) {
     }
     $this->assertEquals(0, $properties->getFlags());
 }
 /**
  * Sets the state on deserialization.
  * 
  * @param array $state
  * @return ezcPersistentObjectProperties
  */
 public static function __set_state(array $state)
 {
     $properties = new ezcPersistentObjectProperties();
     if (isset($state['properties']) && count($state) === 1) {
         $properties->exchangeArray($state['properties']);
     } else {
         // Old style exports
         $properties->exchangeArray($state);
     }
     return $properties;
 }