Download the PHP package jinya/pdox without Composer

On this page you can find all versions of the php package jinya/pdox. 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 pdox


permalink: index.html layout: "default"

PDOx

PDOx is a small PDO extension that enables developers to simple run a single query to map a table to the desired object. For this purpose it utilizes either native PDO or laminas-hydrator.

Installation

Simply run composer require jinya/pdox in your project.

Usage

PDOx contains three methods apart from the default PDO methods.

$pdo->fetchObject($query, $prototype, $parameters, $strategies)

This method allows you to fetch one single object from the query and hydrate the result into a class of the type of $prototype. An example call can look like this:

The code above is really simple, as first parameter you give it the query, as second parameter a new instance of the object the PDOx should hydrate into, as third the parameters of your query and lastly the strategies. Strategies are a component of laminas hydrator and you can find our more about them here.

$pdo->fetchIterator($query, $prototype, $parameters, $strategies)

This method allows you to fetch an iterator of objects from the query and hydrate the results into a class of the type of $prototype. An example call can look like this:

The method call for fetchIterator and fetchObject is basically the same. You only need to replace the method name and PDOx does the rest for you.

$pdo->fetchArray($query, $prototype, $parameters, $strategies)

This method allows you to fetch an iterator of objects from the query and hydrate the results into a class of the type of $prototype. An example call can look like this:

The method call for fetchArray and fetchIterator is basically the same. You only need to replace the method name and PDOx does the rest for you.

Configuration

PDOx introduces two new fields for the PDO options. These are passed in the constructor. Using these new options you can control whether PDOx should transform the field names and how it should handle empty results by returning null or throwing an exception.

PDOx::PDOX_NAMING_UNDERSCORE_TO_CAMELCASE

Possible Value: true or false

Purpose: Controls whether the casing should be converted between underscore case in the database to CamelCase in PHP

PDOx::PDOX_NO_RESULT_BEHAVIOR

Possible value: PDOx::PDOX_NO_RESULT_BEHAVIOR_NULL or PDOx::PDOX_NO_RESULT_BEHAVIOR_EXCEPTION

Purpose: Controls how PDOx should handle no result in fetchObject

Found a bug?

If you found a bug feel free to create an issue on Github or on our Taiga instance: https://taiga.imanuel.dev/project/pdox/

License

Like all other Jinya projects, PDOx is distributed under the MIT License.


All versions of pdox with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
ext-pdo Version *
laminas/laminas-hydrator Version ^4.14.0
jetbrains/phpstorm-attributes Version ^1.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 jinya/pdox contains the following files

Loading the files please wait ....