1. Go to this page and download the library: Download star/specification 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/ */
Between::integers('alias', 'age', 18, 40);
Between::dates('alias', 'published_at', new \DateTime('1900-01-01'), new \DateTime('2000-01-01 12:34:56'));
Contains::string('alias', 'name', 'Joe');
EndsWith::string('alias', 'name', 'Joe');
Greater::thanInteger('alias', 'age', 18);
Greater::thanDate('alias', 'born_at', new \DateTime('2000-01-01'));
GreaterEquals::thanInteger('alias', 'age', 18);
GreaterEquals::thanDate('alias', 'born_at', new \DateTime('2000-01-01'));
InArray::ofIntegers('alias', 'age', 18, 20, 34); // would return items with age 18, 20 or 34.
new IsEmpty('alias', 'name');
new IsNot(Lower::thanInteger('alias', 'age', 18)); // would return items with age >= 19.
new IsNull('alias', 'age');
Lower::thanInteger('alias', 'age', 18);
Lower::thanDate('alias', 'age', new \DateTime('2000-01-01'));
LowerEquals::thanInteger('alias', 'age', 18);
LowerEquals::thanDate('alias', 'age', new \DateTime('2000-01-01'));
StartsWith::string('alias', 'name', 'Joe');
// equivalent to "name = 'Joe' AND active = true"
new AndX(
EqualsTo::stringValue('alias', 'name', 'Joe'),
EqualsTo::booleanValue('alias', 'active', true),
);
// equivalent to "name = 'Joe' OR active = true"
new OrX(
EqualsTo::stringValue('alias', 'name', 'Joe'),
EqualsTo::booleanValue('alias', 'active', true),
);
new AndX(
OrderBy::desc('alias', 'is_active'),
OrderBy::asc('alias', 'age'),
OrderBy::desc('alias', 'name'),
);
new OrX(
OrderBy::desc('alias', 'is_active'),
OrderBy::asc('alias', 'age'),
OrderBy::desc('alias', 'name'),
);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.