Download the PHP package litvinenko/object without Composer
On this page you can find all versions of the php package litvinenko/object. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download litvinenko/object
More information about litvinenko/object
Files in litvinenko/object
Package object
Short Description Litvinenko\Common\Object class that powers Varien Object class with data validation rules taken from 'illuminate\validation' package
License
Informations about the package object
Extended Varien_Object
Here is Litvinenko\Common\Object class that powers Varien_Object class (see http://docs.magentocommerce.com/Varien/Varien_Object/Varien_Object.html, http://alanstorm.com/magento_varien_object_debugging) with data validation rules taken from 'illuminate\validation' package (https://packagist.org/packages/illuminate/validation).
With this object, you have automatically getters, setters, unsetters and functions like 'has
Litvinenko\Common\Object class has isValid method that returns TRUE, if object data satisfies object data rules.
For example, for our User object we require login field, user email (which should look like real email) and user id (which should be integer). We will have class like that:
Now, we can create some user and check whether it has valid data.
We even can get all validation errors
That's it!
Installation
Change logs:
- version 0.0.2: added new convenient validation rules 'float', 'float_strict', 'integer_strict', 'more_than', 'less_than', 'more_than_or_equal', 'less_than_or_equal' (see bootstrap.php)
- version 0.0.3: added 'object' data rule (see bootstrap.php) and add/remove/set methods for data rules to Litvinenko\Common\Object
All versions of object with dependencies
illuminate/validation Version *
illuminate/translation Version ~4.2
illuminate/container Version ~4.2