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