Download the PHP package tiriel/firestore-odm-bundle without Composer

On this page you can find all versions of the php package tiriel/firestore-odm-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package firestore-odm-bundle

Firestore ODM Bundle

A small bundle to persist and manage entities with Google Cloud Firestore Database in Symfony applications.

Requirements

This bundle requires PHP 8.2+ and Symfony 7+.

This bundle also relies heavily on Google Glouc Firestore PHP Client, and its technical requirements are the same (most notably PHP gRPC and Protobuf extensions). See Google's documentation for more details.

Installation

If you have Symfony Flex, a contrib recipe is available:

That's it, you're good to go.

If you haven't got Flex installed, first require the bundle as shown above. Then, enable the bundle in the config/bundles.php file:

You can now create a config/packages/tiriel.yaml with the following content:

Usage

DTOs or Entities

Every DTO class in your application will create a new collection based on its FQCN in your Firestore database.

You can use whatever DTO you want as entities. The only requirement is that they implement Tiriel\FirestoreOdmBundle\Dto\Interface\PersistableDtoInterface as a marker, and to ensure a getId() method is present. This id can be a string, integer, or Symfony Uuid.

Example:

You can now create a manager for your DTO.

DTO Managers

To perform queries on your Firestore DTOs, you need to create a manager extending Tiriel\FirestoreOdmBundle\Manager\FirestoreDtoManager. Inside, override the value of the FirestoreDtoManager::DTO_CLASS constant by specifying which DTO this manager is attached to:

And you're done, you can use your new DTO and its manager.

Internally, the bundle creates an alias for your Manager to be autowired as DtoManagerInterface $dtoNameManager.

Example with our ImageFirestoreDtoManager:

Available methods

All managers provide you with the same interface and methods:

All managers also include a protected CollectionReference $collection object from Google\Cloud\Firestore\CollectionReference. You can use it to create your own custom queries or pagination inside your Manager.

Usage with Symfony Security

If you want to use Firestore to store the users for your security flow, you can check my other bundle: Firestore-Security-Bridge.

This package defines classes and User Providers to help you use Firestore as the source of your users.


All versions of firestore-odm-bundle with dependencies

PHP Build Version
Package Version
Requires symfony/http-kernel Version ^6.4||^7.0
symfony/config Version ^6.4||^7.0
symfony/dependency-injection Version ^6.4||^7.0
symfony/serializer Version ^6.4||^7.0
google/cloud-firestore Version ^1.43
symfony/uid Version ^6.4||^7.0
symfony/property-access Version ^6.4||^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tiriel/firestore-odm-bundle contains the following files

Loading the files please wait ....