2017 © Pedro Peláez
 

library wpexpress-query

A WPDB abstraction

image

page-carbajal/wpexpress-query

A WPDB abstraction

  • Sunday, February 11, 2018
  • by pagecarbajal
  • Repository
  • 1 Watchers
  • 0 Stars
  • 94 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 11 Versions
  • 0 % Grown

The README.md

WPExpress/Query

An abstraction layer for WPDB., (*1)

Love WordPress I started looking for a composer package to abstract working with the WPDB the way we work with databases on other PHP projects., (*2)

None met my expectations, some try to skip the WBDP and write SQL on their own. WPDB is robust enough, I just want a wrapper that makes read and writing code easier., (*3)

The Query class is a container for static methods to instantiate every class (Post, MetaField, Taxonomy) related to the DB., (*4)

You can use WPExpress/Query to simplify your interactions with the WPDB and make your code easier to read and write., (*5)

Run a DB Query for Custom Post Type BOOKS, and limit to 5 results, (*6)

function getFiveBooksPermalinks()
{
    $list = array();
    $fiveBooks = Query::Custom('book')->limit(5)->get();

    foreach($fiveBooks as $post)
    {
        $list[] = get_permalink($post->ID);
    }
    return $list;
}

Run a DB Query to get 5 posts, (*7)

    $Posts = Posts()->limit(5)->get();

    foreach($Posts as $post)
    {
        // TODO: Write your code here
    }

Road Map

Next minor

  • Add methods insert, save and delete to Post class
  • Develop methods for User class
    • insert
    • save
    • delete
    • resetPassword
    • get, get first, get last
    • getAll
    • getByMeta
    • getByEmail
  • Add method Query::User. Returns an instance of User

The Versions

11/02 2018

dev-new-models

dev-new-models https://github.com/Page-Carbajal/WPExpress

A WPDB abstraction

  Sources   Download

GNU-3.0 GPL-3.0-or-later

11/02 2018

dev-master

9999999-dev https://github.com/Page-Carbajal/WPExpress

A WPDB abstraction

  Sources   Download

GNU-3.0 GPL-3.0-or-later

11/02 2018

dev-development

dev-development https://github.com/Page-Carbajal/WPExpress

A WPDB abstraction

  Sources   Download

GPL-3.0-or-later

11/02 2018

1.0.1

1.0.1.0 https://github.com/Page-Carbajal/WPExpress

A WPDB abstraction

  Sources   Download

GPL-3.0-or-later

11/02 2018

dev-fix/license-issue

dev-fix/license-issue https://github.com/Page-Carbajal/WPExpress

A WPDB abstraction

  Sources   Download

GPL-3.0-or-later

10/02 2016

0.10.4

0.10.4.0 https://github.com/Page-Carbajal/WPExpress

A WPDB abstraction

  Sources   Download

GNU-3.0

10/02 2016

0.10.3

0.10.3.0 https://github.com/Page-Carbajal/WPExpress

A WPDB abstraction

  Sources   Download

GNU-3.0

09/02 2016

0.10.2

0.10.2.0 https://github.com/Page-Carbajal/WPExpress

A WPDB abstraction

  Sources   Download

GNU-3.0

09/02 2016

0.10.1

0.10.1.0 https://github.com/Page-Carbajal/WPExpress

A WPDB abstraction

  Sources   Download

GNU-3.0

14/01 2016
12/01 2016