public function fromArray($values, $arrayKeyValue = null)
{
if ($this->arrayKey && null !== $arrayKeyValue) {
$this->setArrayKeyValue($arrayKeyValue);
}
if (!is_array($values)) {
if (null !== $this->nodeValueVar) {
$setter = 'set' . ucfirst($this->nodeValueVar);
if (method_exists($this, $setter)) {
$this->{$setter}($values);
}
}
} else {
foreach ($values as $key => $value) {
$this->propertyFromArray($key, $value);
}
}
}
/** * @param array $values * @param string $key */ public function fromArray($values, $key = null) { parent::fromArray($values, $key); if (is_string($key)) { $this->setId($key); } }