PHP Classes


Recommend this page to a friend!
  Classes of Alexey Dodonov  >  Mezon Fields Set  >  >  Download  
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: Mezon Fields Set
Manipulate a set of field types and constraints
Author: By
Last change:
Date: 1 year ago
Size: 1,175 bytes


Class file image Download

Base application class Build Status codecov


You may need to store a list of typed fields for some purposes. So this class doing exactly what you need.


Just print

composer require mezon/fields-set


The creation is quite simple

$fieldsSet = new \Mezon\FieldsSet([
    'id' => [
        'type' => 'int',
        'title' => 'id of the record'
    'title' => [
        'type' => 'string',
        'title' => 'some title'
    'description' => [
        'type' => 'string',
        'title' => 'quite obvious yeah?)'


Method returns all fields in the set

public function getFields(): array

Method validates if the field exists in our set

public function hasField(string $fieldName): bool

Method returns a list of fields'es names as array:

public function getFieldsNames(): array
For more information send a message to info at phpclasses dot org.