public function initialize($values = null, $jarves = null)
{
if (null === $this->rootName) {
$array = explode('\\', get_called_class());
$this->rootName = lcfirst(array_pop($array));
}
if (!$jarves) {
$jarves = static::$serialisationJarvesCore;
}
if ($jarves) {
$this->setJarves($jarves);
}
if ($values) {
if (is_string($values)) {
$dom = new \DOMDocument();
$dom->loadXml($values);
$this->element = $dom->firstChild;
$this->setupObject($jarves);
$this->checkRequirements();
} else {
if ($values instanceof \DOMElement) {
$this->element = $values;
$this->setupObject($jarves);
$this->checkRequirements();
} else {
if (is_array($values)) {
$this->fromArray($values);
$this->checkRequirements();
}
}
}
}
}