/** * Sets the state on deserialization. * * @param array $state * @return ezcPersistentRelationCollection */ public static function __set_state(array $state) { $relations = new ezcPersistentRelationCollection(); $relations->exchangeArray($state); return $relations; }
public function testExchangeArrayInvalidValueFailure() { $col = new ezcPersistentRelationCollection(); try { $col->exchangeArray(array('foo' => new stdClass())); $this->fail('Exception not thrown on invalid value.'); } catch (ezcBaseValueException $e) { } try { $col->exchangeArray(array('foo' => 23)); $this->fail('Exception not thrown on invalid value.'); } catch (ezcBaseValueException $e) { } }