quick
quick copied to clipboard
Update HasOneOrMany Relationship Class to Allow Returning a New Entity
Being able to create a new HasOneOrMany
relationship entity is great, but sometimes you need access to the new entity before persistence. Adding a newEntity()
method gives additional flexibility and also plays nicely with other relationship types.
Additionally, being able to call something like prc.post.postCategories().newEntity()
is much cleaner than using the current workaround, which is prc.post.postCategories().getRelated().newEntity()