2017 © Pedro Peláez
 

library wp-tools-db

Some DB tools for WP

image

mishterk/wp-tools-db

Some DB tools for WP

  • Saturday, December 9, 2017
  • by mishterk
  • Repository
  • 1 Watchers
  • 0 Stars
  • 15 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 9 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

WP DB Tools

Some tools for working with the DB in WordPress., (*1)

DB\Model()

Simple base model for modeling custom DB tables in WordPress. Using this class will allow you to;, (*2)

  1. setup the table schema
  2. define primary key (supports composites)
  3. create/update the database using the create_table() method (via WP's built-in dbDelta() function)
  4. drop the table
  5. run various queries on your table such as;
    1. Get a single row by ID (composite supported)
    2. Get rows where xxx
    3. Insert new rows
    4. Insert or update a row, if it already exists
    5. Delete a row

To use, extend \Mishterk\WP\Tools\DB\Model with your own model and implement required methods. You can then call the $model->create_table() method on your instance to create/update the database with your new table., (*3)

See the following test classes for a look at how your custom class will look;, (*4)

tests/resources/class-test-model.php
tests/resources/class-test-model-composite-key.php, (*5)

Currently, the class will set itself up with the necessary dependencies ($wpdb and a built in adaptor), but these can be overridden using a constructor arg array., (*6)

The Versions

09/12 2017

dev-master

9999999-dev

Some DB tools for WP

  Sources   Download

MIT

The Requires

  • php ^5.6 || ^7.0

 

by Phil Kurth

09/12 2017

0.1.6

0.1.6.0

Some DB tools for WP

  Sources   Download

MIT

The Requires

  • php ^5.6 || ^7.0

 

by Phil Kurth

09/12 2017

0.1.5

0.1.5.0

Some DB tools for WP

  Sources   Download

MIT

The Requires

  • php ^5.6 || ^7.0

 

by Phil Kurth

02/09 2017

0.1.4

0.1.4.0

Some DB tools for WP

  Sources   Download

MIT

The Requires

  • php ^5.6 || ^7.0

 

by Phil Kurth

29/08 2017

0.1.3

0.1.3.0

Some DB tools for WP

  Sources   Download

MIT

The Requires

  • php ^5.6 || ^7.0

 

by Phil Kurth

29/08 2017

0.1.2

0.1.2.0

Some DB tools for WP

  Sources   Download

MIT

The Requires

  • php ^5.6 || ^7.0

 

by Phil Kurth

21/08 2017

0.1.1

0.1.1.0

Some DB tools for WP

  Sources   Download

MIT

The Requires

  • php ^5.6 || ^7.0

 

by Phil Kurth

17/08 2017

0.1.0

0.1.0.0

Some DB tools for WP

  Sources   Download

MIT

The Requires

  • php ^5.6 || ^7.0

 

by Phil Kurth

09/08 2017

0.0.1

0.0.1.0

Some DB tools for WP

  Sources   Download

The Requires

  • php ^5.6 || ^7.0