mocks.js
function(parentObj) {
		this.getDb().validateRelationship(this.getType(), this.relationship)
		var objDesc = this.getDb().schema[this.getType()];
		var relDesc = null;
		for(var i = 0; i < objDesc.childRelationships.length; i++)
			if(this.relationship === objDesc.childRelationships[i].relationshipName)
				relDesc = objDesc.childRelationships[i];
		if(relDesc == null)
			throw 'No child relationship by the name: ' + this.relationship + ' exists in the type: ' + this.getType();
		var relObjDesc = this.getDb().schema[relDesc.childSObject];

		var all = this.getDb().getSobjects(relDesc.childSObject);
		var result = [];
		for(var key in all) {
			var obj = all[key];
			if(obj[relDesc.field] === parentObj.Id && (!this.condition || this.condition.matches(obj)))
				result.push(this._createResultObj(obj));
		}
		return this.getDb().wrapResult(result);
	}
function(parentObj) {
		this.getDb().validateRelationship(this.getType(), this.relationship)
		var objDesc = this.getDb().schema[this.getType()];
		var relDesc = null;
		for(var i = 0; i < objDesc.childRelationships.length; i++)
			if(this.relationship === objDesc.childRelationships[i].relationshipName)
				relDesc = objDesc.childRelationships[i];
		if(relDesc == null)
			throw 'No child relationship by the name: ' + this.relationship + ' exists in the type: ' + this.getType();
		var relObjDesc = this.getDb().schema[relDesc.childSObject];

		var all = this.getDb().getSobjects(relDesc.childSObject);
		var result = [];
		for(var key in all) {
			var obj = all[key];
			if(obj[relDesc.field] === parentObj.Id && (!this.condition || this.condition.matches(obj)))
				result.push(this._createResultObj(obj));
		}
		return this.getDb().wrapResult(result);
	}
function ( parentObj ) { this . getDb ( ) . validateRelationship ( this . getType ( ) , this . relationship ) var objDesc = this . getDb ( ) . schema [ this . getType ( ) ] ; var relDesc = null ; for ( var i = 0 ; i < objDesc . childRelationships . length ; i ++ ) if ( this . relationship === objDesc . childRelationships [ i ] . relationshipName ) relDesc = objDesc . childRelationships [ i ] ; if ( relDesc == null ) throw 'No child relationship by the name: ' + this . relationship + ' exists in the type: ' + this . getType ( ) ; var relObjDesc = this . getDb ( ) . schema [ relDesc . childSObject ] ; var all = this . getDb ( ) . getSobjects ( relDesc . childSObject ) ; var result = [ ] ; for ( var key in all ) { var obj = all [ key ] ; if ( obj [ relDesc . field ] === parentObj . Id && ( ! this . condition || this . condition . matches ( obj ) ) ) result . push ( this . _createResultObj ( obj ) ) ; } return this . getDb ( ) . wrapResult ( result ) ; }
Runs the query against the db
Runs the query against the db