stack

Home > @infiniteobjects/models > BaseFirebaseEntity

BaseFirebaseEntity class

An Abstract class that Firebase Entities need to extend.

Signature:

export declare abstract class BaseFirebaseEntity 

Remarks

This only applies to data stored in Firebase

Properties

Property Modifiers Type Description
_initialized   boolean Is this entry initialized?
_new   boolean Is this a new entry?
_populated   boolean Is this entry populated
dateCreated   Date The date that the entry was created.
dateUpdated   Date The date that the entry was last updated.
debug readonly DebugInstance A debug function under the name io:model:name
id   string Unique identifier of the document on the collection
log readonly LoggerInstance A Logger instance under the name io:model:name

Methods

Method Modifiers Description
afterInsert()   Called after storing the document for the first time
afterRemove()   Called after removing the document
afterUpdate()   Called after updating the document
beforeInsert()   Called before storing the document for the first time.
beforeRemove()   Called before removing the document
beforeUpdate()   Called before updating the document
onInit()   Called internally after a document is: - Returned from the DB. - A new Instance is created - On new documents after the doc.OnCreate() hook.
onPopulate()   Called on population, it should populate the DB joins.
serialize(kind) protected Serializes this class to one of the transfor types
toEmbedded() abstract Serializes this class as an simplified object
toModel(admin) abstract Serializes this class back to the model
toSchema() abstract Serializes this class to the Schema type
validate(reject)   Validates the instance
validate(reject)    
validate(reject)