lib/packages/core-classes.js
function(local_record, referenced_record) {

		var referenced_guid = referenced_record.guid;

		if (referenced_guid in this._collections_by_foreign_guid) {

			if (Lava.schema.DEBUG && this._collections_by_foreign_guid[referenced_guid].indexOf(local_record) != -1)
				Lava.t("Duplicate record");
			this._collections_by_foreign_guid[referenced_guid].push(local_record);

		} else {

			this._collections_by_foreign_guid[referenced_guid] = [local_record];

		}

		this._fire('added_child', {
			collection_owner: referenced_record,
			child: local_record
		});

	}
function(local_record, referenced_record) {

		var referenced_guid = referenced_record.guid;

		if (referenced_guid in this._collections_by_foreign_guid) {

			if (Lava.schema.DEBUG && this._collections_by_foreign_guid[referenced_guid].indexOf(local_record) != -1)
				Lava.t("Duplicate record");
			this._collections_by_foreign_guid[referenced_guid].push(local_record);

		} else {

			this._collections_by_foreign_guid[referenced_guid] = [local_record];

		}

		this._fire('added_child', {
			collection_owner: referenced_record,
			child: local_record
		});

	}
function ( local_record , referenced_record ) { var referenced_guid = referenced_record . guid ; if ( referenced_guid in this . _collections_by_foreign_guid ) { if ( Lava . schema . DEBUG && this . _collections_by_foreign_guid [ referenced_guid ] . indexOf ( local_record ) != - 1 ) Lava . t ( "Duplicate record" ) ; this . _collections_by_foreign_guid [ referenced_guid ] . push ( local_record ) ; } else { this . _collections_by_foreign_guid [ referenced_guid ] = [ local_record ] ; } this . _fire ( 'added_child' , { collection_owner : referenced_record , child : local_record } ) ; }
Add `local_record` to field's internal collection of records from local module, referenced by `referenced_record`
@param {Lava.data.Record} local_record
@param {Lava.data.Record} referenced_record The collection owner
Add local_record to field s internal collection of records from local module referenced by referenced_record