ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ILIAS\Data\Description\Description Class Reference

This describes some datastructure in terms of standard data structures such as primitives, lists, maps and objects and helpful (hopefully...) human readable texts. More...

+ Inheritance diagram for ILIAS\Data\Description\Description:
+ Collaboration diagram for ILIAS\Data\Description\Description:

Public Member Functions

 __construct (protected ?Text\SimpleDocumentMarkdown $description,)
 
 getDescription ()
 
 getPrimitiveRepresentation (mixed $data)
 Each of the types that can be described has a canonical representation created from primitive PHP types. More...
 
 matches (mixed $data)
 

Detailed Description

This describes some datastructure in terms of standard data structures such as primitives, lists, maps and objects and helpful (hopefully...) human readable texts.

The class is not to be derived but instead acts as a common base class for all classes Description* in the subfolder. The set of Description* classes is fixed.

Definition at line 32 of file Description.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Data\Description\Description::__construct ( protected ?Text\SimpleDocumentMarkdown  $description)

Definition at line 34 of file Description.php.

36  {
37  }

Member Function Documentation

◆ getDescription()

ILIAS\Data\Description\Description::getDescription ( )

Definition at line 39 of file Description.php.

References $data, and ILIAS\Data\Description\Description\getPrimitiveRepresentation().

39  : ?Text\SimpleDocumentMarkdown
40  {
41  return $this->description;
42  }
+ Here is the call graph for this function:

◆ getPrimitiveRepresentation()

ILIAS\Data\Description\Description::getPrimitiveRepresentation ( mixed  $data)
abstract

Each of the types that can be described has a canonical representation created from primitive PHP types.

This attempts to transform the provided data into such a representation.

If this returns a , the data cannot be transformed into such a representation and the will produce a generator that provides a list of defects where $data does not match the description. If this does return something else it will be plain old php data according to the description.

Referenced by ILIAS\Data\Description\Description\getDescription(), and ILIAS\Data\Description\Description\matches().

+ Here is the caller graph for this function:

◆ matches()

ILIAS\Data\Description\Description::matches ( mixed  $data)

Definition at line 56 of file Description.php.

References ILIAS\Data\Description\Description\getPrimitiveRepresentation().

56  : bool
57  {
58  if ($this->getPrimitiveRepresentation($data) instanceof \Generator) {
59  return false;
60  }
61 
62  return true;
63  }
getPrimitiveRepresentation(mixed $data)
Each of the types that can be described has a canonical representation created from primitive PHP typ...
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: