Skip to content

Commit

Permalink
FileMapping
Browse files Browse the repository at this point in the history
  • Loading branch information
simonaiuliana committed Jun 20, 2024
1 parent bac4788 commit 2c5ff2e
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 111 deletions.
111 changes: 0 additions & 111 deletions test/simona/02-mapping/model/Mapping/ExempleMapping.php

This file was deleted.

59 changes: 59 additions & 0 deletions test/simona/02-mapping/model/Mapping/FileMapping.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?php

namespace model\Mapping;

use Exception;

class FileMapping
{

protected ?int $file_id;
protected ?string $file_url;
protected ?string $file_description;
protected ?string $file_type;


public function getFileId(): ?int
{
return $this->file_id;
}

public function setFileId(?int $file_id): void
{
if ($file_id <= 0) {
throw new Exception("ID non valide");
}
$this->file_id = $file_id;
}

public function getFileUrl(): ?string
{
return html_entity_decode($this->file_url);
}

public function setFileUrl(?string $file_url): void
{
$text = htmlspecialchars(trim(strip_tags($file_url)), ENT_QUOTES);
$this->file_url = $text;
}

public function getFileDescription(): ?string
{
return $this->file_description;
}

public function setFileDescription(?string $file_description): void
{
$this->file_description = $file_description;
}

public function getFileType(): ?string
{
return $this->file_type;
}

public function setFileType(?string $file_type): void
{
$this->file_type = $file_type;
}
}

0 comments on commit 2c5ff2e

Please sign in to comment.