PHPackages                             jinya/pdox - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. jinya/pdox

AbandonedArchivedLibrary[Database &amp; ORM](/categories/database)

jinya/pdox
==========

Jinya PDOx is a simple object mapper built around PHPs standard PDO

0.10.1(2y ago)11.4kMITPHPPHP &gt;=8.1

Since Jul 27Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Jinya-CMS/pdox)[ Packagist](https://packagist.org/packages/jinya/pdox)[ RSS](/packages/jinya-pdox/feed)WikiDiscussions main Synced 4d ago

READMEChangelog (1)Dependencies (5)Versions (54)Used By (0)

   permalink index.html   layout default  PDOx
====

[](#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
------------

[](#installation)

Simply run `composer require jinya/pdox` in your project.

Usage
-----

[](#usage)

PDOx contains three methods apart from the default PDO methods.

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

[](#pdo-fetchobjectquery-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:

```
