@@ -569,8 +569,7 @@ public function &__get($name) {
569569 if (!isset ($ this ->fieldDefinitions )) {
570570 $ this ->getFieldDefinitions ();
571571 }
572- // Apigee base fields are special, so they need special treatment.
573- if (isset ($ this ->fieldDefinitions [$ name ]) && !($ this ->fieldDefinitions [$ name ] instanceof BaseFieldDefinition)) {
572+ if (isset ($ this ->fieldDefinitions [$ name ])) {
574573 $ return = $ this ->getField ($ name );
575574 return $ return ;
576575 }
@@ -607,6 +606,11 @@ public function __set($name, $value) {
607606 $ this ->getField ($ name )->setValue ($ value );
608607 }
609608 }
609+ // The translations array is unset when cloning the entity object, we just
610+ // need to restore it.
611+ elseif ($ name == 'translations ' ) {
612+ $ this ->translations = $ value ;
613+ }
610614 // Directly write non-field values.
611615 else {
612616 $ this ->values [$ name ] = $ value ;
@@ -636,6 +640,17 @@ public function __unset($name) {
636640 }
637641 }
638642
643+ /**
644+ * An array of entity translation metadata.
645+ *
646+ * An associative array keyed by translation language code. Every value is an
647+ * array containing the translation status and the translation object, if it has
648+ * already been instantiated.
649+ *
650+ * @var array
651+ */
652+ private $ translations = [];
653+
639654 /**
640655 * Gets a non-translatable field.
641656 *
0 commit comments