Skip to content
Snippets Groups Projects
Commit dd1c9919 authored by Josh Pollock's avatar Josh Pollock
Browse files

document simple quries

parent 05a38e51
No related branches found
No related tags found
No related merge requests found
[![Build Status](https://travis-ci.org/calderawp/caldera-forms-query.svg?branch=master)](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.
......@@ -28,4 +28,6 @@ class FunctionsTest extends IntegrationTestCase
CalderaFormsQueries()->set('sivan', 'roy' );
$this->assertEquals( 'roy', CalderaFormsQueries()->get('sivan') );
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment