izzle / model
Simple model lib
Installs: 10 174
Dependents: 4
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^7.4|^8.0
- ext-json: *
- izzle/support: ^1.0.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.8.0
- phpunit/phpunit: ^9.5
- symfony/var-dumper: ^v7.1.0
README
Izzle Model Library
- Installing
Use Composer (recommended)
As IO Izzle uses Composer to manage its dependencies, the recommended way to create a new project is to use it.
If you don't have Composer yet, download it following the instructions on http://getcomposer.org/ or just run the following command:
curl -s http://getcomposer.org/installer | php
Then, use the install
command to generate a new ICS application:
php composer.phar install
Composer will install Izzle IO and all its dependencies under the specified directory.
Usage
Entity Class extending:
class Book extends Model {}
Adding property informations to your new entity class
/**
* @return PropertyCollection
*/
protected function loadProperties(): PropertyCollection
{
return new PropertyCollection([
new PropertyInfo('id', 'int', 0),
new PropertyInfo('name', 'string'),
new PropertyInfo('i18ns', BookI18n::class, [], true, true),
new PropertyInfo('invisibilities', 'int', [], false, true)
]);
}