You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.1 KiB
55 lines
1.1 KiB
<?php
|
|
|
|
namespace BusinessClass;
|
|
|
|
abstract class Question implements IResponseProcessingStrategy, IPrintQuestionStrategy
|
|
{
|
|
private string $content;
|
|
private array $categories; // Liste d'objets Category
|
|
|
|
/**
|
|
* @param string $content
|
|
* @param array $categories
|
|
*/
|
|
public function __construct(string $content, array $categories)
|
|
{
|
|
$this->content = $content;
|
|
$this->categories = $categories;
|
|
}
|
|
|
|
public abstract function responseStrategy();
|
|
|
|
public abstract function printStrategy(): string;
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getContent(): string
|
|
{
|
|
return $this->content;
|
|
}
|
|
|
|
/**
|
|
* @param string $content
|
|
*/
|
|
public function setContent(string $content): void
|
|
{
|
|
$this->content = $content;
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
public function getCategories(): array
|
|
{
|
|
return $this->categories;
|
|
}
|
|
|
|
/**
|
|
* @param array $categories
|
|
*/
|
|
public function setCategories(array $categories): void
|
|
{
|
|
$this->categories = $categories;
|
|
}
|
|
} |