Set parent field value to child - variants
11778
protected function _assignParentDependFields()
    {
        $sParent = $this->getParentArticle();
        if ($sParent) {
            foreach ($this->_getCopyParentFields() as $sField) {
                $this->$sField = new \OxidEsales\Eshop\Core\Field($sParent->$sField->value);
            }
        }
    }
399596
protected void initFields(Element parent, CmsXmlContentDefinition contentDef) throws CmsXmlException {

        for (Element fieldElem : parent.elements(N_SETTING)) {
            initField(fieldElem, contentDef);
        }
    }
964029
def collectChildProperties(self, kwargs, properties, collector, **kw):
        """"""

        childProperties = {}
        for field in self.fields:  # pylint: disable=not-an-iterable
            yield collector.collectValidationErrors(field.fullName,
                                                    field.updateFromKwargs,
                                                    kwargs=kwargs,
                                                    properties=childProperties,
                                                    collector=collector,
                                                    **kw)
        kwargs[self.fullName] = childProperties
799550
function(parent) {
    function error(usage) {
      return new Error('Template theme fields are not permitted '+ usage +':\n>>> '+ Node.toString(parent));
    }

    // Check for arguments implementation:
    if (parent.type === NodeType.ARGUMENTS) {
      throw error('as arguments');
    }

    // Check for interpolations implementation:
    if (parent.type === NodeType.INTERPOLATION) {
      throw error('in interpolations');
    }

    // Check for operations implementation:
    for (var i=0; i < parent.content.length; i++) {
      if (NodeType.OPERATOR.test(parent.content[i].type)) {
        throw error('in operations');
      }
    }
  }
798066
function mergeOptions (
	  parent,
	  child,
	  vm
	) {
	  normalizeComponents(child);
	  normalizeProps(child);
	  normalizeDirectives(child);
	  var extendsFrom = child.extends;
	  if (extendsFrom) {
	    parent = typeof extendsFrom === 'function'
	      ? mergeOptions(parent, extendsFrom.options, vm)
	      : mergeOptions(parent, extendsFrom, vm);
	  }
	  if (child.mixins) {
	    for (var i = 0, l = child.mixins.length; i < l; i++) {
	      var mixin = child.mixins[i];
	      if (mixin.prototype instanceof Vue$3) {
	        mixin = mixin.options;
	      }
	      parent = mergeOptions(parent, mixin, vm);
	    }
	  }
	  var options = {};
	  var key;
	  for (key in parent) {
	    mergeField(key);
	  }
	  for (key in child) {
	    if (!hasOwn(parent, key)) {
	      mergeField(key);
	    }
	  }
	  function mergeField (key) {
	    var strat = strats[key] || defaultStrat;
	    options[key] = strat(parent[key], child[key], vm, key);
	  }
	  return options
	}
498075
def set_attributes(self, doc, fields,  # pylint: disable=arguments-differ
            parent_type=None, catch_all_field=None):
        
        if parent_type:
            assert isinstance(parent_type, Union)

        super(Union, self).set_attributes(doc, fields, parent_type)

        self.catch_all_field = catch_all_field
        self.parent_type = parent_type
1235817
private void changeSimpleValue(String attributeName, int index, String value, List<String> parentPathElements) {

        CmsAttributeHandler handler = getAttributeHandler(attributeName, parentPathElements);
        handler.changeValue(value, index);
    }
323477
public void setParentKetMetadata(ParentKeyMetadata parentKeyMetadata) {
    if (this.parentKeyMetadata != null) {
      String format = "Class %s has two fields, %s and %s marked with %s annotation. Only one "
          + "field can be marked as ParentKey. ";
      String message = String.format(format, entityClass.getName(),
          this.parentKeyMetadata.getName(), parentKeyMetadata.getName(), ParentKey.class.getName());
      throw new EntityManagerException(message);

    }
    this.parentKeyMetadata = parentKeyMetadata;
  }
1107581
def setFieldValues( fields, editRecord=true )
      if fields.is_a?(Hash)
          clearFieldValuePairList
          fields.each{ |fieldName,fieldValue|
             addFieldValuePair( fieldName, nil, nil, fieldValue )
          }
          if editRecord and @dbid and (@rid or @key)
            editRecord( @dbid, @rid, @fvlist, nil, nil, nil, nil, nil, @key )
          end
      end
   end
742043
def serialize_on_parent(
            self,
            parent,  # type: ET.Element
            value,  # type: Any
            state  # type: _ProcessorState
    ):
        # type: (...) -> None
        """"""
        xml_value = _hooks_apply_before_serialize(self._hooks, state, value)
        self._processor.serialize_on_parent(parent, xml_value, state)
183535
function populateRelatedFields(record, includedMap, parents) {

        // IF: Object has relationships, update so this record is listed as a parent
        if (record.relationships) {
            parents = parents ? parents.concat([record]) : [record] ;
        }

        each(
            record.relationships,
            function(relationship, property) {
                // IF: relationship describes non-record specific meta;
                // append relationship meta to the record
                if (relationship && isObject(relationship.meta)) {
                    record.meta = record.meta || {};
                    record.meta[property] = relationship.meta;
                }

                // IF: No relationship data, don't add anything
                if (!relationship.data) {
                    return;
                }

                // IF: Relationship has multiple matches, create an array for matched records
                // ELSE: Assign relationship directly to the property
                if (isArray(relationship.data)) {
                    record.attributes[property] = map(
                        relationship.data,
                        function(data) {
                            return getMatchingRecord(data, includedMap, parents);
                        }
                    );
                }
                else {
                    record.attributes[property] = getMatchingRecord(
                        relationship.data,
                        includedMap,
                        parents
                    );
                }
            }
        );
    }
672423
public static void setFieldValue(Field field, Object obj, Object value) {
    if (Modifier.isFinal(field.getModifiers())) {
      Object finalValue = getFieldValue(field, obj);
      if (value == null ? finalValue != null : !value.equals(finalValue)) {
        throw new IllegalArgumentException(
            "expected final value <"
                + finalValue
                + "> but was <"
                + value
                + "> on "
                + field.getName()
                + " field in "
                + obj.getClass().getName());
      }
    } else {
      try {
        field.set(obj, value);
      } catch (SecurityException e) {
        throw new IllegalArgumentException(e);
      } catch (IllegalAccessException e) {
        throw new IllegalArgumentException(e);
      }
    }
  }
1234583
def _set_fields(self, fields):
        """"""
        super(_BaseHNVModel, self)._set_fields(fields)
        if not self.resource_ref:
            endpoint = self._endpoint.format(
                resource_id=self.resource_id, parent_id=self.parent_id,
                grandparent_id=self.grandparent_id)
            self.resource_ref = re.sub("(/networking/v[0-9]+)", "", endpoint)
114152
def _set_child(self, name, child):
        
        if not isinstance(child, Parentable):
            raise ValueError('Parentable child object expected, not {child}'.format(child=child))
        child._set_parent(self)
        self._store_child(name, child)
364537
private function setCustomFields()
    {
        $customFieldCollection = new CustomFieldCollection();

        if (isset($this->simpleXml->{'custom-fields'})) {
            /** @var SimpleXMLElement $field */
            foreach ($this->simpleXml->{'custom-fields'}->children() as $field) {
                $customField = $this->convertToCustomField($field);
                if (!is_null($customField)) {
                    $customFieldCollection->add($customField);
                }
            }
        }
        $this->customFields = $customFieldCollection;
    }
607750
protected void detectDirtyFields(Widget parent) {
        if (parent instanceof HasWidgets) {
            for (Widget widget : (HasWidgets) parent) {
                if (widget instanceof HasValue) {
                    HasValue valueWidget = (HasValue) widget;
                    registrations.add(valueWidget.addValueChangeHandler(event -> {
                        if (valueWidget.getValue() != null && ! valueWidget.getValue().equals("")) {
                            setDirty(true);
                        }
                    }));
                } else {
                    if (propagateToChildren) {
                        detectDirtyFields(widget);
                    }
                }
            }
        }
    }
250136
def _set_field_if_present(cls, block, name, value, attrs):
        """"""
        if name in block.fields:
            value = (block.fields[name]).from_string(value)
            if "none" in attrs and attrs["none"] == "true":
                setattr(block, name, None)
            else:
                setattr(block, name, value)
        else:
            logging.warning("XBlock %s does not contain field %s", type(block), name)