Reference Source
import Discussion from 'flarum/common/models/Discussion'
public class | source

Discussion

Extends:

Model → Discussion

Inherited Summary

From class Model
public static

attribute(name: String, transform: function): *

Generate a function which returns the value of the given attribute.

public static

Generate a function which returns the value of the given has-many relationship.

public static

Generate a function which returns the value of the given has-one relationship.

public static

Transform the given value into a Date object.

protected static

Get a resource identifier object for the given model.

public

The resource object from the API.

public

Whether or not the resource exists on the server.

public

The time at which the model's data was last updated. Watching the value of this property is a fast way to retain/cache a subtree if data hasn't changed.

protected

The data store that this resource should be persisted to.

public

attribute(attribute: String): *

Get one of the model's attributes.

public

copyData(): *

public

delete(body: Object, options: Object): Promise

Send a request to delete the resource.

public

id(): Integer

Get the model's ID.

public

pushAttributes(attributes: Object)

Merge new attributes into this model locally.

public

pushData(data: Object)

Merge new data into this model locally.

public

save(attributes: Object, options: Object): Promise

Merge new attributes into this model, both locally and with persistence.

protected

Construct a path to the API endpoint for this resource.