diff --git a/README.md b/README.md index 444f297793d7887cfbf2912abf6938d8276b28af..1a8c81876791a6f178f4aa816eac387a11ae978a 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,37 @@ [](https://travis-ci.org/calderawp/caldera-forms-query) +## Usage -## Development +```php +/** + * Examples of simple queries + * + * Using the class: \calderawp\CalderaFormsQuery\Features\FeatureContainer + * Via the static accessor function: calderawp\CalderaFormsQueries\CalderaFormsQueries() + */ + +/** First make the function usable without a full namespace */ +use function calderawp\CalderaFormsQueries\CalderaFormsQueries; + +/** Do Some Queries */ +//Select all data by user ID +$entries = CalderaFormsQueries()->selectByUserId(42); + +//Select all entries that have a field whose slug is "email" and the value of that field's value is "delete@please.eu" +$entries = CalderaFormsQueries()->selectByFieldValue( 'email', 'delete@please.eu' ); +//Select all entries that do not have field whose slug is "size" and the value of that field's value is "big" +$entries = CalderaFormsQueries()->selectByFieldValue( 'size', 'big', false ); +//Delete all data by Entry ID +CalderaFormsQueries()->deleteByEntryIds([1,1,2,3,5,8,42]); + +//Delete all data by User ID +CalderaFormsQueries()->deleteByUserId(42); +``` + + +## Development ### Install Requires git and Composer @@ -39,3 +67,5 @@ Run these commands from the plugin's root directory. * Fix All Code Formatting - `composer formatting` +## Stuff. +Copyright 2018 CalderaWP LLC. License: GPL v2 or later. diff --git a/Tests/Integration/FunctionsTest.php b/Tests/Integration/FunctionsTest.php index 44ce1602e10188fc44136066475031b8a1467c31..279d236fbaa6b8e4419f92b6dc5f1e5dfd94ff08 100644 --- a/Tests/Integration/FunctionsTest.php +++ b/Tests/Integration/FunctionsTest.php @@ -28,4 +28,6 @@ class FunctionsTest extends IntegrationTestCase CalderaFormsQueries()->set('sivan', 'roy' ); $this->assertEquals( 'roy', CalderaFormsQueries()->get('sivan') ); } + + } \ No newline at end of file