ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ILIAS\TA\Questions\assSuggestedSolutionFile Class Reference

a suggested solution for file-contents More...

+ Inheritance diagram for ILIAS\TA\Questions\assSuggestedSolutionFile:
+ Collaboration diagram for ILIAS\TA\Questions\assSuggestedSolutionFile:

Public Member Functions

 __construct (int $id, int $question_id, int $subquestion_index, string $import_id, \DateTimeImmutable $last_update, string $type, string $value)
 
 getType ()
 
 getStorableValue ()
 
 getTitle ()
 
 withTitle (string $title)
 
 getMime ()
 
 withMime (string $mime)
 
 getSize ()
 
 withSize (int $size)
 
 getFilename ()
 
 withFilename (string $filename)
 
- Public Member Functions inherited from ILIAS\TA\Questions\assQuestionSuggestedSolution
 __construct (int $id, int $question_id, int $subquestion_index, string $import_id, \DateTimeImmutable $last_update)
 
 getType ()
 
 getStorableValue ()
 
 getId ()
 
 withId (int $id)
 
 getQuestionId ()
 
 withQuestionId (int $question_id)
 
 getImportId ()
 
 withImportId (string $import_id)
 
 getSubquestionIndex ()
 
 withSubquestionIndex (int $subquestion_index)
 
 getLastUpdate ()
 
 isOfTypeFile ()
 
 isOfTypeLink ()
 

Data Fields

const ARRAY_KEY_FILENAME = 'name'
 
const ARRAY_KEY_TITLE = 'filename'
 
const ARRAY_KEY_MIME = 'type'
 
const ARRAY_KEY_SIZE = 'size'
 
- Data Fields inherited from ILIAS\TA\Questions\assQuestionSuggestedSolution
const TYPE_LM = 'lm'
 
const TYPE_LM_CHAPTER = 'st'
 
const TYPE_LM_PAGE = 'pg'
 
const TYPE_GLOSARY_TERM = 'git'
 
const TYPE_FILE = 'file'
 
const TYPES
 

Protected Attributes

string $filename
 
string $mime
 
int $size = 0
 
string $title
 
- Protected Attributes inherited from ILIAS\TA\Questions\assQuestionSuggestedSolution
int $id
 
int $question_id
 
int $subquestion_index
 
string $import_id
 
DateTimeImmutable $last_update
 

Detailed Description

a suggested solution for file-contents

Author
Nils Haagen nils..nosp@m.haag.nosp@m.en@co.nosp@m.ncep.nosp@m.ts-an.nosp@m.d-tr.nosp@m.ainin.nosp@m.g.de

Definition at line 27 of file assSuggestedSolutionFile.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\TA\Questions\assSuggestedSolutionFile::__construct ( int  $id,
int  $question_id,
int  $subquestion_index,
string  $import_id,
\DateTimeImmutable  $last_update,
string  $type,
string  $value 
)

Definition at line 39 of file assSuggestedSolutionFile.php.

References ILIAS\MetaData\Repository\Validation\Data\__construct().

47  {
49  $v = unserialize($value, []);
50 
51  $this->title = $v[self::ARRAY_KEY_TITLE] ?? '';
52  $this->filename = $v[self::ARRAY_KEY_FILENAME] ?? '';
53  $this->size = $v[self::ARRAY_KEY_SIZE] ?? 0;
54  $this->mime = $v[self::ARRAY_KEY_MIME] ?? '';
55  }
__construct(VocabulariesInterface $vocabularies)
+ Here is the call graph for this function:

Member Function Documentation

◆ getFilename()

ILIAS\TA\Questions\assSuggestedSolutionFile::getFilename ( )

Definition at line 108 of file assSuggestedSolutionFile.php.

References ILIAS\TA\Questions\assSuggestedSolutionFile\$filename.

Referenced by ILIAS\TA\Questions\assSuggestedSolutionFile\getStorableValue().

108  : string
109  {
110  return $this->filename;
111  }
+ Here is the caller graph for this function:

◆ getMime()

ILIAS\TA\Questions\assSuggestedSolutionFile::getMime ( )

◆ getSize()

ILIAS\TA\Questions\assSuggestedSolutionFile::getSize ( )

◆ getStorableValue()

ILIAS\TA\Questions\assSuggestedSolutionFile::getStorableValue ( )

Definition at line 62 of file assSuggestedSolutionFile.php.

References ILIAS\TA\Questions\assSuggestedSolutionFile\getFilename(), ILIAS\TA\Questions\assSuggestedSolutionFile\getMime(), ILIAS\TA\Questions\assSuggestedSolutionFile\getSize(), and ILIAS\TA\Questions\assSuggestedSolutionFile\getTitle().

62  : string
63  {
64  return serialize([
65  self::ARRAY_KEY_FILENAME => $this->getFilename(),
66  self::ARRAY_KEY_MIME => $this->getMime(),
67  self::ARRAY_KEY_SIZE => $this->getSize(),
68  self::ARRAY_KEY_TITLE => $this->getTitle()
69  ]);
70  }
+ Here is the call graph for this function:

◆ getTitle()

ILIAS\TA\Questions\assSuggestedSolutionFile::getTitle ( )

◆ getType()

ILIAS\TA\Questions\assSuggestedSolutionFile::getType ( )

Definition at line 57 of file assSuggestedSolutionFile.php.

57  : string
58  {
59  return parent::TYPE_FILE;
60  }

◆ withFilename()

ILIAS\TA\Questions\assSuggestedSolutionFile::withFilename ( string  $filename)

Definition at line 112 of file assSuggestedSolutionFile.php.

References ILIAS\TA\Questions\assSuggestedSolutionFile\$filename.

112  : static
113  {
114  $clone = clone $this;
115  $clone->filename = $filename;
116  return $clone;
117  }

◆ withMime()

ILIAS\TA\Questions\assSuggestedSolutionFile::withMime ( string  $mime)

Definition at line 90 of file assSuggestedSolutionFile.php.

References ILIAS\TA\Questions\assSuggestedSolutionFile\$mime.

90  : static
91  {
92  $clone = clone $this;
93  $clone->mime = $mime;
94  return $clone;
95  }

◆ withSize()

ILIAS\TA\Questions\assSuggestedSolutionFile::withSize ( int  $size)

Definition at line 101 of file assSuggestedSolutionFile.php.

References ILIAS\TA\Questions\assSuggestedSolutionFile\$size.

101  : static
102  {
103  $clone = clone $this;
104  $clone->size = $size;
105  return $clone;
106  }

◆ withTitle()

ILIAS\TA\Questions\assSuggestedSolutionFile::withTitle ( string  $title)

Definition at line 79 of file assSuggestedSolutionFile.php.

References ILIAS\TA\Questions\assSuggestedSolutionFile\$title.

Referenced by assQuestionSuggestedSolutionTest\testSuggestedSolutionMutatorsFile().

79  : static
80  {
81  $clone = clone $this;
82  $clone->title = $title;
83  return $clone;
84  }
+ Here is the caller graph for this function:

Field Documentation

◆ $filename

◆ $mime

string ILIAS\TA\Questions\assSuggestedSolutionFile::$mime
protected

◆ $size

int ILIAS\TA\Questions\assSuggestedSolutionFile::$size = 0
protected

◆ $title

string ILIAS\TA\Questions\assSuggestedSolutionFile::$title
protected

◆ ARRAY_KEY_FILENAME

const ILIAS\TA\Questions\assSuggestedSolutionFile::ARRAY_KEY_FILENAME = 'name'

Definition at line 29 of file assSuggestedSolutionFile.php.

◆ ARRAY_KEY_MIME

const ILIAS\TA\Questions\assSuggestedSolutionFile::ARRAY_KEY_MIME = 'type'

Definition at line 31 of file assSuggestedSolutionFile.php.

◆ ARRAY_KEY_SIZE

const ILIAS\TA\Questions\assSuggestedSolutionFile::ARRAY_KEY_SIZE = 'size'

Definition at line 32 of file assSuggestedSolutionFile.php.

◆ ARRAY_KEY_TITLE

const ILIAS\TA\Questions\assSuggestedSolutionFile::ARRAY_KEY_TITLE = 'filename'

Definition at line 30 of file assSuggestedSolutionFile.php.


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