morrislaptop / firestore-php

Firestore SDK for PHP without gRPC
MIT License
67 stars 31 forks source link

Code not working (v2.1.2) #3

Closed rohit1290 closed 6 years ago

rohit1290 commented 6 years ago

Which one is the correct code??

collection = self::$firestore->getCollection('users');
$user = $collection->getDocument('123456');

or

collection = $firestore->collection('users');
$user = $collection->document('123456');

I cannot find getCollection or getDocument function in any of the class.

The second code is working for me but I am getting a new error PHP Fatal error: Uncaught Error: Class 'Morrislaptop\Firestore\PermissionDenied' not found

morrislaptop commented 6 years ago

I've added the PermissionDenied class, but there will still be a problem with your auth credentials if it's getting to that bit of the code.

rohit1290 commented 6 years ago

what about the first part of the question? Which one is the correct code??

morrislaptop commented 6 years ago

Second one.