parent
8c76e93af2
commit
7d791a728e
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
require_once('model/Fichier.php');
|
||||
|
||||
class Dossier extends Fichier {
|
||||
private array $elements;
|
||||
|
||||
public function __construct(String $nom, String $path, array $elements){
|
||||
parent::__construct($nom, $path);
|
||||
$this->elements = $elements;
|
||||
}
|
||||
|
||||
public function addFichier(Fichier $file){
|
||||
array_push($this->elements, $file);
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
class Fichier {
|
||||
private String $fileName;
|
||||
private String $path;
|
||||
|
||||
public function __construct(String $name, String $path){
|
||||
$this->fileName = $name;
|
||||
$this->path = $path;
|
||||
}
|
||||
|
||||
public function getName(): String{
|
||||
return $this->fileName;
|
||||
}
|
||||
|
||||
public function getPath(): String{
|
||||
return $this->path;
|
||||
}
|
||||
|
||||
public function setName(String $newName){
|
||||
$this->fileName = $newName;
|
||||
}
|
||||
|
||||
public function setPath(String $newPath){
|
||||
$this->path = $newPath;
|
||||
}
|
||||
}
|
Loading…
Reference in new issue