Download the PHP package ssnepenthe/wpdb-engine-for-latitude without Composer
On this page you can find all versions of the php package ssnepenthe/wpdb-engine-for-latitude. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ssnepenthe/wpdb-engine-for-latitude
More information about ssnepenthe/wpdb-engine-for-latitude
Files in ssnepenthe/wpdb-engine-for-latitude
Package wpdb-engine-for-latitude
Short Description Build queries for wpdb using the latitude query builder
License MIT
Informations about the package wpdb-engine-for-latitude
wpdb-engine-for-latitude
Use the latitude query builder to build queries for use in wpdb
.
Warning
This package is currently in development and is subject to breaking changes without notice until v1.0 has been tagged.
It is one in a series of WordPress toys I have been working on with the intention of exploring ways to modernize the feel of working with WordPress.
As the label suggests, it should be treated as a toy.
Installation
Usage
Start by reviewing the latitude documentation. Using this package will be largely the same.
The important differences are noted below:
WpdbEngine
The engine provided to the query factory should always be an instance of WpdbEngine
:
Field Function
In place of the Latitude\QueryBuilder\field()
function, use WpdbEngineForLatitude\field()
:
Search Function
In place of the Latitude\QueryBuilder\search()
function, use WpdbEngineForLatitude\search()
:
With Wpdb
Once you have compiled a query instance you should pass the sql and params through the wpdb->prepare()
method to get your final query string:
And finally use it with any of the wpdb
query methods:
More Examples
Please refer to the tests in tests/CodeReferenceExamplesTest.php
- The examples from the wpdb
code reference page have been re-implemented there.