ktamas77 / firebase-php

Firebase PHP Client
792 stars 215 forks source link

Delete Array of References #62

Closed marcoas closed 7 years ago

marcoas commented 7 years ago

(Translated by Google)

I think it would be useful, to be able to establish an Array of references, to the method DELETE, to be able to eliminate many places, with a single call

$info = '/path/to/delete'
$firebase->delete( $info )

or

$info[] = '/path/to/delete/1'
$info[] = '/path/to/delete/2'
$firebase->delete( $info )
ktamas77 commented 7 years ago

I was trying to keep the implementation as simple as possible to support the basic functions of firebase. Your request could be easily implemented this way:

foreach ($info as $item) {
    $firebase->delete($item);
}

you can also easily extend the current Firebase class and add helper functions for this specific use case.