Packagecom.myflashlab.air.extensions.firebase.db
Classpublic class DBReference
InheritanceDBReference Inheritance DBQuery Inheritance 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.



Public Properties
 PropertyDefined 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
 Inheritedreference : 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
Public Methods
 MethodDefined By
  
child($path:String):DBReference
Get a reference to location relative to this one
DBReference
 Inherited
endAt($value:*, $key:String = null):DBQuery
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
 Inherited
equalTo($value:*, $key:String = null):DBQuery
Create a query constrained to only return child nodes with the given value.
DBQuery
 Inherited
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
 Inherited
limitToFirst($limit:int):DBQuery
Create a query with limit and anchor it to the start of the window
DBQuery
 Inherited
limitToLast($limit:int):DBQuery
Create a query with limit and anchor it to the end of the window
DBQuery
 Inherited
orderByChild($path:String):DBQuery
Create a query in which child nodes are ordered by the values of the specified path.
DBQuery
 Inherited
Create a query in which child nodes are ordered by their keys.
DBQuery
 Inherited
Create a query in which child nodes are ordered by their priorities.
DBQuery
 Inherited
Create a query in which nodes are ordered by their value
DBQuery
  
Create a reference to an auto-generated child location.
DBReference
  
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
 Inherited
startAt($value:*, $key:String = null):DBQuery
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
Property Detail
keyproperty
key:String  [read-only]

The last token in the location pointed to by this reference


Implementation
    public function get key():String
parentproperty 
parent:DBReference  [read-only]

A DatabaseReference to the parent location, or null if this instance references the root location


Implementation
    public function get parent():DBReference
rootproperty 
root:DBReference  [read-only]

A reference to the root location of this Firebase Database


Implementation
    public function get root():DBReference
Method Detail
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

Returns
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.

Returns
DBReference
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.

Returns
Boolean — 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

Returns
DBWhenDisconnect