sunnysideup / orm-extras
Make it easier to work with the ORM with some short-cuts
Installs: 67
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Type:silverstripe-vendormodule
Requires
- silverstripe/recipe-core: ^4.0 || ^5.0
This package is auto-updated.
Last update: 2024-11-30 02:13:42 UTC
README
TL;DR
filter without worrying about empty arrays
$filterSafeArray = ArraMethods::filter_array([]); $list = MyDataObject::get()->filter($filterSafeArray);
sort by any id sequence
$sortByStatement = ArraMethods::create_sort_statement_from_id_array([44,222,434,22,]); $sortedList = MyDataObject::get()->orderBy($sortByStatement);
Documentation
Requirements
See composer.json for details
Suggested Modules
See composer.json for details
Installation
composer require sunnysideup/orm-extras
Configuration
In the _config
folder you will find the orm-extras.yml.example
file that shows options for the configuration of this module.
We recommend that you:
- copy these
orm-extras.yml.example
files into yourapp/_config
folder (where available - otherwise search forprivate static $
in the module to see what can be configured) - remove the .example extension,
- delete the lines you do not care about, and
- adjust the configurations that you would like to use.
Contributing
We welcome any contributions. See CONTRIBUTING.md for more details.
Paid assistance
You can pay us to create an improved / adapted version of this module for your own projects. Please contact us if you like to find out more: www.sunnysideup.co.nz. For example, we can write tests for this module.
Author
Sunny Side Up Ltd.
Care to see more modules?
To find other modules, please visit ssmods.com.