Filter - magnussolution/magnusbilling-api GitHub Wiki
Welcome to the magnusbilling-api-php wiki!
How use setFilter method.
<?php
require_once "vendor/autoload.php";
use magnusbilling\api\magnusBilling;
$magnusBilling = new MagnusBilling('API KEY', 'SECRET KEY');
$magnusBilling->public_url = "http://1.1.1.1/mbilling"; // Your MagnusBilling URL
//set filter to find data that have credit > 10, type numeric.
$magnusBilling->setFilter('credit', '10', 'gt', 'numeric');
//you can set multiple filter: ex
$magnusBilling->setFilter('credit', '50', 'lt', 'numeric');
//above filter will find per credit > 10 and < 50
//execute the read method on user medule
$result = $magnusBilling->read('user');
print($result);
This method has 4 variables.
- Field (required).
- Value (required)
- Comparison (optional)
- Filter Type (optional)
Filter Type:
- string Comparison available:
- st = Start with
- ed = End with
- ct = Contain
- eq = Equal
- numeric Comparison available:
- eq = Equal
- lt = Less than
- gt = Great than
- date Comparison available:
- eq = eq
- lt = Less than
- gt = Great than