Commit ccc65da7 authored by xjm's avatar xjm

Issue #2854926 by xjm, borisson_, boaloysius: Remove unneeded control...

Issue #2854926 by xjm, borisson_, boaloysius: Remove unneeded control structures in ContentEntityBase
parent 7e506626
......@@ -1014,11 +1014,10 @@ public function __isset($name) {
if ($this->hasField($name)) {
return TRUE;
}
// For non-field properties, check the internal values.
else {
return isset($this->values[$name]);
}
}
/**
* Implements the magic method for unset().
......@@ -1027,12 +1026,12 @@ public function __unset($name) {
// Unsetting a field means emptying it.
if ($this->hasField($name)) {
$this->get($name)->setValue(array());
return TRUE;
}
// For non-field properties, unset the internal value.
else {
unset($this->values[$name]);
}
}
/**
* {@inheritdoc}
......@@ -1067,7 +1066,10 @@ public function createDuplicate() {
public function __clone() {
// Avoid deep-cloning when we are initializing a translation object, since
// it will represent the same entity, only with a different active language.
if (!$this->translationInitialize) {
if ($this->translationInitialize) {
return TRUE;
}
// The translation is a different object, and needs its own TypedData
// adapter object.
$this->typedData = NULL;
......@@ -1123,7 +1125,6 @@ public function __clone() {
}
}
}
}
/**
* {@inheritdoc}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment