mirror of
https://github.com/Karaka-Management/oms-Surveys.git
synced 2026-02-16 23:28:39 +00:00
cleanup and tests added for ci/cd
This commit is contained in:
parent
259c61ac77
commit
dbae99d7d0
|
|
@ -49,67 +49,67 @@ class Answer
|
||||||
*/
|
*/
|
||||||
private string $description = '';
|
private string $description = '';
|
||||||
|
|
||||||
private static $instances = [];
|
/**
|
||||||
|
* Get model id.
|
||||||
public function getInstance($id)
|
*
|
||||||
{
|
* @return int
|
||||||
if (!isset(self::$instances[$id])) {
|
*
|
||||||
self::$instances[$id] = new self($id);
|
* @since 1.0.0
|
||||||
}
|
*/
|
||||||
|
public function getId() : int
|
||||||
return self::$instances[$id];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function init($id) : void
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public function __clone()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getId()
|
|
||||||
{
|
{
|
||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getName()
|
/**
|
||||||
|
* Get answer name/title.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function getName() : string
|
||||||
{
|
{
|
||||||
return $this->name;
|
return $this->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setName($name) : void
|
/**
|
||||||
|
* Get name/title.
|
||||||
|
*
|
||||||
|
* @param string $name Name/title
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function setName(string $name) : void
|
||||||
{
|
{
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDescription()
|
/**
|
||||||
|
* Get description.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function getDescription() : string
|
||||||
{
|
{
|
||||||
return $this->description;
|
return $this->description;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setDescription($desc) : void
|
/**
|
||||||
|
* Set description.
|
||||||
|
*
|
||||||
|
* @param string $desc Description
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function setDescription(string $desc) : void
|
||||||
{
|
{
|
||||||
$this->description = $desc;
|
$this->description = $desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function delete() : void
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public function create() : void
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public function update() : void
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public function serialize() : void
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public function unserialize($data) : void
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,67 +49,67 @@ class Question
|
||||||
*/
|
*/
|
||||||
private string $description = '';
|
private string $description = '';
|
||||||
|
|
||||||
private static $instances = [];
|
/**
|
||||||
|
* Get id.
|
||||||
public function getInstance($id)
|
*
|
||||||
{
|
* @return int
|
||||||
if (!isset(self::$instances[$id])) {
|
*
|
||||||
self::$instances[$id] = new self($id);
|
* @since 1.0.0
|
||||||
}
|
*/
|
||||||
|
public function getId() : int
|
||||||
return self::$instances[$id];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function init($id) : void
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public function __clone()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getId()
|
|
||||||
{
|
{
|
||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getName()
|
/**
|
||||||
|
* Get name/title.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function getName() : string
|
||||||
{
|
{
|
||||||
return $this->name;
|
return $this->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setName($name) : void
|
/**
|
||||||
|
* Set name/title.
|
||||||
|
*
|
||||||
|
* @param string $name Name/title
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function setName(string $name) : void
|
||||||
{
|
{
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDescription()
|
/**
|
||||||
|
* Get string.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function getDescription() : string
|
||||||
{
|
{
|
||||||
return $this->description;
|
return $this->description;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set description.
|
||||||
|
*
|
||||||
|
* @param string $desc Description
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
public function setDescription($desc) : void
|
public function setDescription($desc) : void
|
||||||
{
|
{
|
||||||
$this->description = $desc;
|
$this->description = $desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function delete() : void
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public function create() : void
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public function update() : void
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public function serialize() : void
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public function unserialize($data) : void
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,85 +49,67 @@ class Section
|
||||||
*/
|
*/
|
||||||
private string $description = '';
|
private string $description = '';
|
||||||
|
|
||||||
private static $instances = [];
|
/**
|
||||||
|
* Get id.
|
||||||
public function getInstance($id)
|
*
|
||||||
{
|
* @return int
|
||||||
if (!isset(self::$instances[$id])) {
|
*
|
||||||
self::$instances[$id] = new self($id);
|
* @since 1.0.0
|
||||||
}
|
*/
|
||||||
|
public function getId() : int
|
||||||
return self::$instances[$id];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getId()
|
|
||||||
{
|
{
|
||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getName()
|
/**
|
||||||
|
* Get name.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function getName() : string
|
||||||
{
|
{
|
||||||
return $this->name;
|
return $this->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setName($name) : void
|
|
||||||
{
|
|
||||||
$this->name = $name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getDescription()
|
|
||||||
{
|
|
||||||
return $this->description;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setDescription($desc) : void
|
|
||||||
{
|
|
||||||
$this->description = $desc;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function delete() : void
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public function create() : void
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public function update() : void
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public function serialize() : void
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public function unserialize($data) : void
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Init object by ID.
|
* Set name.
|
||||||
*
|
*
|
||||||
* This usually happens from DB or cache
|
* @param string $name Name
|
||||||
*
|
|
||||||
* @param int $id Object ID
|
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function init($id) : void
|
public function setName(string $name) : void
|
||||||
{
|
{
|
||||||
// TODO: Implement init() method.
|
$this->name = $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Overwriting clone in order to maintain singleton pattern.
|
* Get description.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function __clone()
|
public function getDescription() : string
|
||||||
{
|
{
|
||||||
// TODO: Implement __clone() method.
|
return $this->description;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set description.
|
||||||
|
*
|
||||||
|
* @param string $desc Description
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function setDescription(string $desc) : void
|
||||||
|
{
|
||||||
|
$this->description = $desc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,10 +52,10 @@ class Survey
|
||||||
/**
|
/**
|
||||||
* Created.
|
* Created.
|
||||||
*
|
*
|
||||||
* @var datetime
|
* @var \DateTime
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
private $created = null;
|
private \DateTime $created;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creator.
|
* Creator.
|
||||||
|
|
@ -65,87 +65,127 @@ class Survey
|
||||||
*/
|
*/
|
||||||
private ?int $creator = null;
|
private ?int $creator = null;
|
||||||
|
|
||||||
private static $instances = [];
|
/**
|
||||||
|
* Constructor.
|
||||||
public function getInstance($id)
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
{
|
{
|
||||||
if (!isset(self::$instances[$id])) {
|
$this->created = new \DateTime('now');
|
||||||
self::$instances[$id] = new self($id);
|
|
||||||
}
|
|
||||||
|
|
||||||
return self::$instances[$id];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function init($id) : void
|
/**
|
||||||
{
|
* Get id.
|
||||||
}
|
*
|
||||||
|
* @return int
|
||||||
public function __clone()
|
*
|
||||||
{
|
* @since 1.0.0
|
||||||
}
|
*/
|
||||||
|
public function getId() : int
|
||||||
public function getId()
|
|
||||||
{
|
{
|
||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getName()
|
/**
|
||||||
|
* Get name/title.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function getName() : string
|
||||||
{
|
{
|
||||||
return $this->name;
|
return $this->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setName($name) : void
|
/**
|
||||||
|
* Set name/title.
|
||||||
|
*
|
||||||
|
* @param string $name Name/title
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function setName(string $name) : void
|
||||||
{
|
{
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDescription()
|
/**
|
||||||
|
* Get description.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function getDescription() : string
|
||||||
{
|
{
|
||||||
return $this->description;
|
return $this->description;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setDescription($desc) : void
|
/**
|
||||||
|
* Set description.
|
||||||
|
*
|
||||||
|
* @param string $desc Description
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function setDescription(string $desc) : void
|
||||||
{
|
{
|
||||||
$this->description = $desc;
|
$this->description = $desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCreated()
|
/**
|
||||||
|
* Get created.
|
||||||
|
*
|
||||||
|
* @return \DateTime
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function getCreated() : \DateTime
|
||||||
{
|
{
|
||||||
return $this->created;
|
return $this->created;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set created.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
public function setCreated($created) : void
|
public function setCreated($created) : void
|
||||||
{
|
{
|
||||||
$this->created = $created;
|
$this->created = $created;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get creator.
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
public function getCreator()
|
public function getCreator()
|
||||||
{
|
{
|
||||||
return $this->creator;
|
return $this->creator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set creator.
|
||||||
|
*
|
||||||
|
* @param mixed $creator Creator
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
public function setCreator($creator) : void
|
public function setCreator($creator) : void
|
||||||
{
|
{
|
||||||
$this->creator = $creator;
|
$this->creator = $creator;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function delete() : void
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public function create() : void
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public function update() : void
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public function serialize() : void
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public function unserialize($data) : void
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user