Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions guide/getting-started/creating-new-entities.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,22 @@ var user = getInstance( "User" ).create( {

There is no need to call `save` when using the `create` method.

{% hint style="warning" %}
`create` is a factory method. It creates, saves, and returns a **new entity instance**; it does not fill, save, or otherwise mutate the entity on which it was called. Always use the returned entity when you need the persisted record.
{% endhint %}

```javascript
var user = getInstance( "User" ).newEntity();

user = user.create( {
"username": "JaneDoe",
"email": "jane@example.com",
"password": "mypass1234"
} );

user.isLoaded(); // true
```

## firstOrNew

| Name | Type | Required | Default | Description |
Expand Down