Download the PHP package dmytrof/model-flags without Composer
On this page you can find all versions of the php package dmytrof/model-flags. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download dmytrof/model-flags
More information about dmytrof/model-flags
Files in dmytrof/model-flags
Download dmytrof/model-flags
More information about dmytrof/model-flags
Files in dmytrof/model-flags
Vendor dmytrof
Package model-flags
Short Description Adds flags support to your model/entity
License MIT
Package model-flags
Short Description Adds flags support to your model/entity
License MIT
Please rate this library. Is it a good library?
Informations about the package model-flags
ModelFlags
====================
This ligrary helps you to add flags support to your models, entities etc.
Installation
$ composer require dmytrof/model-flags
Usage
class Blog implements ModelWithFlagsInterface
{
use ModelWithFlagsTrait;
public const SOME_FLAG1 = 1;
public const SOME_FLAG2 = 'FLAG_2';
...............
};
$blog = new Blog();
$blog->hasFlag(Blog::SOME_FLAG1); // false
// Add flags
$blog
->setFlag(Blog::SOME_FLAG1)
->setFlag(Blog::SOME_FLAG2)
->setFlag('myFlag', false)
;
// Get flugs
$flags = $blog->getFlugs(); // [1 => true, 'FLAG_2' => true, 'myFlag' => false]
// Check flag
$blog->hasFlag(Blog::SOME_FLAG1); // true
$blog->hasFlag('myFlag'); // false
$blog->popFlag(Blog::SOME_FLAG2); // true
$blog->popFlag(Blog::SOME_FLAG2); // false
// Remove flag
$blog->removeFlag('myFlag');
$flags = $blog->getFlugs(); // [1 => true]
All versions of model-flags with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.0
The package dmytrof/model-flags contains the following files
Loading the files please wait ....