quick icon indicating copy to clipboard operation
quick copied to clipboard

Eager loading throws error when using CBORMCompatEntity

Open jclausen opened this issue 3 years ago • 0 comments

Due to the overload of the get method in CBORMCompatEntity, the pass through on the with( 'myRelationship' ) when using an in-entity will always fail with the exception: The value returned from the getEager function is not of type array.

CBORM's behavior deviates from the overloaded get in CBORMCompatEntity in two ways:

  1. It allows the method to be run without providing an explicit identifier
  2. It returns a blank entity instead of a null.

As a result of these two behaviors, any invocation of get() on a sub-entity will result in a single empty instance of the entity being returned.

Suggestion: allow get() calls without arguments to pass through to the super scope and set the default of returnNew to false to match CBORM's implementation

jclausen avatar Nov 11 '20 19:11 jclausen