quick
quick copied to clipboard
Eager loading throws error when using CBORMCompatEntity
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:
- It allows the method to be run without providing an explicit identifier
- 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