Package | com.myflashlab.air.extensions.firebase.db |
Class | public class DBReference |
Inheritance | DBReference DBQuery flash.events.EventDispatcher |
A Firebase reference represents a particular location in your Database and can be used for reading or writing data to that Database location.
This class is the starting point for all Database operations. After you've initialized it, you can use it to read data, write data, and to create new DBReferences.
Property | Defined By | ||
---|---|---|---|
key : String [read-only] The last token in the location pointed to by this reference | DBReference | ||
parent : DBReference [read-only] A DatabaseReference to the parent location, or null if this instance references the root location | DBReference | ||
reference : DBReference [read-only]
Returns a DBReference to this location
| DBQuery | ||
root : DBReference [read-only] A reference to the root location of this Firebase Database | DBReference |
Method | Defined By | ||
---|---|---|---|
child($path:String):DBReference
Get a reference to location relative to this one
| DBReference | ||
Create a query constrained to only return child nodes with a value less than or equal to the given value, using
the given orderBy directive or priority as default. | DBQuery | ||
Create a query constrained to only return child nodes with the given value. | DBQuery | ||
keepSynced($keepSynced:Boolean):void
By calling keepSynced(true) on a location, the data for that location will automatically be
downloaded and kept in sync, even when no listeners are attached for that location. | DBQuery | ||
limitToFirst($limit:int):DBQuery
Create a query with limit and anchor it to the start of the window
| DBQuery | ||
limitToLast($limit:int):DBQuery
Create a query with limit and anchor it to the end of the window
| DBQuery | ||
orderByChild($path:String):DBQuery
Create a query in which child nodes are ordered by the values of the specified path. | DBQuery | ||
Create a query in which child nodes are ordered by their keys. | DBQuery | ||
Create a query in which child nodes are ordered by their priorities. | DBQuery | ||
Create a query in which nodes are ordered by their value
| DBQuery | ||
Create a reference to an auto-generated child location. | DBReference | ||
removeValue():void
Set the value at this location to 'null'
| DBReference | ||
runTransaction():Boolean
Run a transaction on the data at this location. | DBReference | ||
setPriority($priority:String):void
Set a priority for the data at this Database location. | DBReference | ||
setValue($value:*, $priority:String = null):void
Set the data and optionally the priority to the given values. | DBReference | ||
Create a query constrained to only return child nodes with a value greater than or equal to the given value,
using the given orderBy directive or priority as default. | DBQuery | ||
updateChildren($childUpdates:Object):void
Update the specific child keys to the specified values. | DBReference | ||
Provides access to disconnect operations at this location | DBReference |
key | property |
key:String
[read-only] The last token in the location pointed to by this reference
public function get key():String
parent | property |
parent:DBReference
[read-only] A DatabaseReference to the parent location, or null if this instance references the root location
public function get parent():DBReference
root | property |
root:DBReference
[read-only] A reference to the root location of this Firebase Database
public function get root():DBReference
child | () | method |
public function child($path:String):DBReference
Get a reference to location relative to this one
Parameters
$path:String — The relative path from this reference to the new one that should be created
|
DBReference — |
push | () | method |
public function push():DBReference
Create a reference to an auto-generated child location. The child key is generated client-side and incorporates an estimate of the server's time for sorting purposes. Locations generated on a single client will be sorted in the order that they are created, and will be sorted approximately in order across all clients.
ReturnsDBReference — |
removeValue | () | method |
public function removeValue():void
Set the value at this location to 'null'
runTransaction | () | method |
public function runTransaction():Boolean
Run a transaction on the data at this location.
ReturnsBoolean — Returns false if another transaction is already in progress.
|
setPriority | () | method |
public function setPriority($priority:String):void
Set a priority for the data at this Database location. Priorities can be used to provide a custom ordering for the children at a location (if no priorities are specified, the children are ordered by key).
You cannot set a priority on an empty location. For this reason setValue(data, priority) should be used when setting initial data with a specific priority and the priority property should be used when updating the priority of existing data.
Parameters
$priority:String — The priority to set at the specified location.
|
setValue | () | method |
public function setValue($value:*, $priority:String = null):void
Set the data and optionally the priority to the given values. the data you can save must be a json type.
Passing an empty string ""
as the value of a key will remove the value at the specified location.
Parameters
$value:* — The value to set at this location (String/Number/Boolean/Object/Array)
| |
$priority:String (default = null ) — The priority to set at this location
|
updateChildren | () | method |
public function updateChildren($childUpdates:Object):void
Update the specific child keys to the specified values. Passing an empty string ""
as the value of
a key will remove the value at the specified location.
Parameters
$childUpdates:Object |
whenDisconnect | () | method |
public function whenDisconnect():DBWhenDisconnect
Provides access to disconnect operations at this location
ReturnsDBWhenDisconnect |