PHP code example of imponeer / criteria

1. Go to this page and download the library: Download imponeer/criteria library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

imponeer / criteria example snippets


use Imponeer\Database\Criteria\CriteriaItem;
use Imponeer\Database\Criteria\CriteriaCompo;

$criteria = new CriteriaCompo();
$criteria->add(new CriteriaItem('status', 'active'));
$criteria->add(new CriteriaItem('age', 18, '>='));

// Generate SQL WHERE clause
$where = $criteria->render();
// $where will be: "(`status` = 'active' AND `age` >= 18)"