forked from WebDevCF2m2023/BlOOG2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bac4788
commit 2c5ff2e
Showing
2 changed files
with
59 additions
and
111 deletions.
There are no files selected for viewing
111 changes: 0 additions & 111 deletions
111
test/simona/02-mapping/model/Mapping/ExempleMapping.php
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |