PHPackages                             jimonade/pdope - 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. jimonade/pdope

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

jimonade/pdope
==============

A composer package that provides solutions for simplifying PDO query parameterization

1.0.10(8y ago)1434MITPHP &gt;=5.3.0

Since Jun 1Compare

[ Source](https://github.com/jimonade/PDope)[ Packagist](https://packagist.org/packages/jimonade/pdope)[ RSS](/packages/jimonade-pdope/feed)WikiDiscussions Synced today

READMEChangelog (1)DependenciesVersions (12)Used By (0)

PDope
=====

[](#pdope)

php pdo practical extensions for simple 1-table mvc models

this helper class is required in your model's base class

```
class DataProperty {
  public $name;
  private $type;
  public $required;

  function __construct($name, $type=NULL, $required=FALSE) {
    $this->name = $name;
    if (empty($type)) {
      $type = "STRING";
    }
    $this->type = $type;
    $this->required = $required;
  }
  public function set_type($type) {
    $this->type = strtoupper($type);
  }
  public function get_type() {
    return $this->type;
  }
}

```

first, define data properties in your model constructor

```
  function __construct($props=null) {
    parent:: __construct($props);

    $this->define_data_property("id", "STRING", TRUE);
    $this->define_data_property("title", "STRING", FALSE);
    $this->define_data_property("description", "STRING", FALSE);
    $this->define_data_property("organization_id", "STRING", FALSE);
    $this->define_data_property("address_line_1", "STRING", FALSE);
    $this->define_data_property("address_line_2", "STRING", FALSE);
    $this->define_data_property("address_line_3", "STRING", FALSE);
    $this->define_data_property("city", "STRING", FALSE);
    $this->define_data_property("state", "STRING", FALSE);
    $this->define_data_property("zip", "STRING", FALSE);
    $this->define_data_property("capacity", "INT", FALSE);
    $this->define_data_property("latitude", "FLOAT", FALSE);
    $this->define_data_property("longitude", "FLOAT", FALSE);
    $this->define_data_property("created_at", "DATE", FALSE);
    $this->define_data_property("updated_at", "DATE", FALSE);
    $this->define_data_property("active", "BOOL", FALSE);
  }

```

example, simple query

```
  $db = new \PDope\Statement("select", "facility", $this);
  $db->add_where_parameters_auto(TRUE);
  return $db->execute();

```

example, simple insert

```
  $db = new \PDope\Statement("insert", "facility", $this);
  $db->add_parameters_auto(TRUE);
  $db->add_parameter("id", "UUID");
  $db->add_parameter("created_at", "NOW");
  $db->add_parameter("updated_at", "NOW");
  $db->execute();

```

example, simple update

```
  $db = new \PDope\Statement("update", "facility", $this);
  $db->add_parameters_auto(TRUE);

  //we dont want to update "id" or "created_at"
  $db->remove_parameter("id");
  $db->remove_parameter("created_at");

  $db->add_parameter("updated_at", "NOW");
  $db->add_where_parameter("id", "STRING");
  $db->execute();

```

example, simple suspend

```
  $db = new \PDope\Statement("update", "facility", $this);
  $db->add_parameter("updated_at", "NOW");
  $db->add_parameter("active");
  $db->add_where_parameter("id");
  $db->execute();

```

example, you can always just use the pdo object to build your own statement from scratch

```
$pdo = \PDope\Connection:: connection();
$statement = $pdo->prepare("SELECT property FROM table WHERE id = :id");
$statement->execute(['id' => $model->id]);
$results = $statement->fetchAll(\PDO::FETCH_OBJ);

```

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~46 days

Recently: every ~102 days

Total

11

Last Release

3220d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1185267?v=4)[Deac Karns](/maintainers/peledies)[@peledies](https://github.com/peledies)

---

Top Contributors

[![jimonade](https://avatars.githubusercontent.com/u/793706?v=4)](https://github.com/jimonade "jimonade (5 commits)")[![sdbjim](https://avatars.githubusercontent.com/u/16027325?v=4)](https://github.com/sdbjim "sdbjim (5 commits)")[![sloane-shark](https://avatars.githubusercontent.com/u/8558044?v=4)](https://github.com/sloane-shark "sloane-shark (5 commits)")[![wdekkers](https://avatars.githubusercontent.com/u/11724672?v=4)](https://github.com/wdekkers "wdekkers (5 commits)")

### Embed Badge

![Health badge](/badges/jimonade-pdope/health.svg)

```
[![Health](https://phpackages.com/badges/jimonade-pdope/health.svg)](https://phpackages.com/packages/jimonade-pdope)
```

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k116.5M113](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[pgvector/pgvector

pgvector support for PHP

198628.3k10](/packages/pgvector-pgvector)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
