Download the PHP package team-mate-pro/doctrine-utils-bundle without Composer

On this page you can find all versions of the php package team-mate-pro/doctrine-utils-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 doctrine-utils-bundle

Team Mate Pro Doctrine Utils Bundle

A Symfony bundle providing Doctrine utilities for file persistence with Flysystem storage backends.

Features

Requirements

Installation

Register the Bundle

If you're not using Symfony Flex, add the bundle to config/bundles.php:

Configuration

Create config/packages/team_mate_pro_doctrine_utils.yaml:

Configuration Options

Option Type Default Description
enable_file_persistence boolean false Enable/disable the file persistence listener
storage_service string 'defaultStorage' Flysystem storage service ID
enable_timestamp_listener boolean false Enable/disable the timestamp listener

Setup

1. Use the Built-in File Entity (Recommended)

The bundle provides a ready-to-use File entity with UUID-based IDs:

The built-in File entity:

Register Doctrine Mapping for the Built-in Entity

To use the built-in File entity, you need to register its mapping in your Doctrine configuration.

Add to config/packages/doctrine.yaml:

Then generate and run the migration:

The migration will create the files table with the following structure:

Column Type Description
id uuid (binary) Primary key (UUID v4)
name varchar(255) Original filename
mime varchar(100) MIME type
bytes integer File size in bytes
real_path varchar(500) Path to the file on disk
created_at datetime_immutable Creation timestamp
file_url varchar(500), nullable Public URL (CDN, S3, etc.)

2. Custom File Entity (Optional)

If you need a custom entity, implement TeamMatePro\Contracts\Model\FileInterface:

Then create a custom factory implementing EntityFileFactoryInterface:

Register your custom factory in config/services.yaml:

3. Configure Flysystem Storage

Using league/flysystem-bundle:

Or define your own Flysystem service:

Usage

Once configured, the bundle automatically handles file persistence:

Disabling File Persistence

To disable the listener without removing the bundle:

When disabled, the service is completely removed from the container (zero overhead).

Using Different Storage Backends

AWS S3

Azure Blob Storage

Testing

Timestamp Listener

The bundle provides automatic timestamping for entities implementing TimeStampAbleInterface.

Setup

  1. Enable the listener in configuration:

  2. Implement TimeStampAbleInterface on your entity:

The listener automatically calls timestamp() on:

Entity Traits

AutoIncrementIdTrait

Provides auto-incrementing integer ID functionality for Doctrine entities.

The trait provides:

UuidIdTrait

Provides UUID-based ID functionality for Doctrine entities using Symfony UID component.

The trait provides:

Helper Functions

The bundle provides utility functions for UUID binary conversion:

Usage in Doctrine Queries

Troubleshooting

Verify Factory Registration

Check Listener Registration

Clear Cache

License

See LICENSE file.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.


All versions of doctrine-utils-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
ext-fileinfo Version *
symfony/framework-bundle Version ^7.0
symfony/dependency-injection Version ^7.0
symfony/config Version ^7.0
symfony/http-foundation Version ^7.0
doctrine/orm Version ^3.0
doctrine/doctrine-bundle Version ^2.0
symfony/uid Version ^7.0
symfony/doctrine-bridge Version ^7.0
league/flysystem Version ^3.0
team-mate-pro/contracts Version ^1.0.11
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 team-mate-pro/doctrine-utils-bundle contains the following files

Loading the files please wait ...