Download the PHP package matatirosoln/doctrine-odata-bundle without Composer

On this page you can find all versions of the php package matatirosoln/doctrine-odata-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-odata-bundle

doctrine-odata-bundle

Symfony bundle for matatirosoln/doctrine-odata-driver.

Integrates the OData DBAL driver into a Symfony application with automatic metadata caching and a set of FileMaker-specific services for scripts, container fields, and value lists.


Requirements

Dependency Version
PHP 8.4+
Symfony 7.x or 8.x
matatirosoln/doctrine-odata-driver ^0.1.0
doctrine/doctrine-bundle ^2.12

Installation

Symfony Flex will register the bundle automatically. Without Flex, add it to config/bundles.php:


Configuration

1. DBAL connection — config/packages/doctrine.yaml

Set the corresponding environment variables in .env.local:

2. Bundle configuration — config/packages/doctrine_odata.yaml

All keys are optional — the defaults shown above apply if omitted:


Metadata caching

The OData $metadata endpoint describes the schema of the database and is required for every request. Without caching it would be fetched on every page load. The bundle wires a DBAL middleware that persists the parsed metadata to the configured Symfony cache pool so that it is only fetched from the server when the cache entry expires.

The middleware is a no-op for any non-OData DBAL connection, so it is safe to use in applications with multiple connections.


Services

The bundle registers the following services, all of which are autowireable by their class name.

ScriptService

Runs a FileMaker script via the OData Script.{name} endpoint.

run() returns the parsed JSON response body as an array. It throws a ScriptException if FileMaker returns a non-zero script result code:

ContainerService

Uploads and downloads binary data to/from FileMaker container fields.

In OData responses, a container field's value is a URL pointing to the binary content. Pass that URL directly to download() or downloadToStream().

Primary key requirement

Container field uploads use the OData key-path URL form (PATCH /EntitySet('key')/Field), which requires the entity set to have a properly defined primary key.

FileMaker OData identifies a field as the primary key if it satisfies both of the following conditions:

If no field meets these criteria, FileMaker falls back to the internal ROWID system field (equivalent to Get(RecordID)). The ROWID is a numeric record ID that changes if a record is deleted and recreated, and is not accessible as a regular application field. A table that relies on ROWID as its OData primary key will not work correctly with container uploads — or with any single-entity OData operation — and should be given an explicit primary key field with the correct field options set in FileMaker.

ValueListService

Fetches FileMaker value lists and returns them in the ['Display Label' => 'stored_value'] format expected by Symfony's ChoiceType.

Requires FileMaker 22 or later. The FileMaker_ValueList_{name} OData endpoints used by this service were introduced in FileMaker 22. Earlier versions expose value list names in $metadata but do not serve the actual entries via OData.

Available methods

Method Description
names(): list<string> All value list names from $metadata — no HTTP request
get(string $name): array Entries for a single list
choices(string $name): array Alias for get()
all(): array All lists keyed by name
clearCache(?string $name): void Invalidate one list or all lists

Caching

Value lists are cached at two layers to minimise OData requests:

  1. Request cache — an in-memory array on the service instance. Within a single request, a list is never fetched more than once regardless of how many times it is accessed.
  2. Session cache — when a Symfony session is active, fetched lists are stored in the session and reused across page loads for the lifetime of that session. This avoids N × OData calls on every form reload without requiring a shared application cache that is difficult to invalidate.

The session cache degrades gracefully to request-only caching for API requests and CLI commands that have no session.

Calling clearCache() removes the named list (or all lists) from both layers simultaneously. The session cache is also automatically cleared when the user's session is destroyed (e.g. on logout).

EntityGeneratorService

Generates Doctrine entity and repository PHP source files from the OData $metadata schema. Intended primarily for use via the CLI command below, but available as an injectable service for programmatic use.


Console commands

doctrine:odata:entity:generate

Generates a Doctrine entity class and its repository from an OData entity set.

Argument Description
entity-set The OData entity set name (as it appears in $metadata)
class-name PHP class name, optionally with sub-namespace using backslashes

Examples:

The command:

Example output for a User entity set with fields __pk_UserID, Name, City:


Exceptions

All bundle exceptions extend RuntimeException and carry structured context:

Exception Thrown by Extra properties
ConnectionException All services
ScriptException ScriptService $scriptName, $scriptCode, $resultParameter

ConnectionException is thrown when a service cannot resolve a DBAL connection backed by ODataDriver. This typically means the connection key in doctrine_odata.yaml does not match the name of the configured OData DBAL connection.


Licence

MIT

Contact

Steve Winter — Matatiro Solutions Ltd — [email protected]


All versions of doctrine-odata-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
matatirosoln/doctrine-odata-driver Version ^0.1.0
psr/simple-cache Version ^3.0
symfony/cache Version ^7.0|^8.0
symfony/config Version ^7.0|^8.0
symfony/console Version ^7.0|^8.0
symfony/dependency-injection Version ^7.0|^8.0
symfony/http-foundation Version ^7.0|^8.0
symfony/http-kernel Version ^7.0|^8.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 matatirosoln/doctrine-odata-bundle contains the following files

Loading the files please wait ...