_createOrAssignChildRecordIfRequired (props, context) {
    const tasks = []

    utils.forEachRelation(this, context.opts, (def, optsCopy) => {
      const relationData = def.getLocalField(context.originalProps)

      if (!relationData) {
        return
      }

      optsCopy.raw = false
      // Create hasMany and hasOne after the main create because we needed
      // a generated id to attach to these items
      if (def.isRequiresChildId()) {
        tasks.push(def.createChildRecord(props, relationData, optsCopy))
      } else if (def.isRequiresParentId()) {
        const parent = def.getLocalField(context.parentRelationMap)

        if (parent) {
          def.setLocalField(props, parent)
        }
      }
    })

    return utils.Promise.all(tasks)
      .then(() => props)
  }
Creates child record for relation types like HasOne or HasMany with foreignKey
in order to satisfy foreignKey dependency (so called parent records).
@param {object} props See {@link Mapper#create}.
@param {object} context contains collected information.
@param {object} context.opts See {@link Mapper#create}.
@param {object} context.parentRelationMap contains parent records map
@param {object} context.originalProps contains data passed into {@link Mapper#create} method
@return {Promise} updated props
@see Mapper#create
@since 3.0.0