public function push($value = null): self
    {
        $value = $value ?? [];

        $newKey = $this->apiClient->push($this->uri, $value);
        $newPath = sprintf('%s/%s', $this->uri->getPath(), $newKey);

        return new self($this->uri->withPath($newPath), $this->apiClient, $this->validator);
    }
public function push($value = null): self
    {
        $value = $value ?? [];

        $newKey = $this->apiClient->push($this->uri, $value);
        $newPath = sprintf('%s/%s', $this->uri->getPath(), $newKey);

        return new self($this->uri->withPath($newPath), $this->apiClient, $this->validator);
    }
public function push ( $ value = null ) : self { $ value = $ value ?? [ ] ; $ newKey = $ this -> apiClient -> push ( $ this -> uri , $ value ) ; $ newPath = sprintf ( '%s/%s' , $ this -> uri -> getPath ( ) , $ newKey ) ; return new self ( $ this -> uri -> withPath ( $ newPath ) , $ this -> apiClient , $ this -> validator ) ; }
Generates a new child location using a unique key and returns its reference.

This is the most common pattern for adding data to a collection of items.

If you provide a value to push(), the value will be written to the generated location.
If you don't pass a value, nothing will be written to the database and the child
will remain empty (but you can use the reference elsewhere).

The unique key generated by push() are ordered by the current time, so the resulting
list of items will be chronologically sorted. The keys are also designed to be
unguessable (they contain 72 random bits of entropy).

@see https://firebase.google.com/docs/reference/js/firebase.database.Reference#push

@param mixed $value

@throws ApiException if the API reported an error

@return Reference A new reference for the added child
Generates a new child location using a unique key and returns its reference .