for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Kerox\Messenger\Model;
use Kerox\Messenger\Model\Data\Value;
class Data
{
/**
* @var null|string
*/
protected $name;
protected $period;
* @var array
protected $values = [];
protected $title;
protected $description;
protected $id;
* @var null|srting
protected $tag;
protected $data;
* Data constructor.
*
* @param array $data
public function __construct(array $data)
$this->name = $data['name'] ?? null;
$this->period = $data['period'] ?? null;
$this->title = $data['title'] ?? null;
$this->description = $data['description'] ?? null;
$this->id = $data['id'] ?? null;
$this->tag = $data['tag'] ?? null;
$this->setValues($data);
}
* @return null|string
public function getName()
return $this->name;
public function getPeriod()
return $this->period;
* @return \Kerox\Messenger\Model\Data\Value[]
public function getValues(): array
return $this->values;
* @return \Kerox\Messenger\Model\Data
public function setValues(array $data): Data
if (isset($data['values']) && !empty($data['values'])) {
foreach ($data['values'] as $value) {
$this->values[] = new Value($value['value'], $value['end_time']);
return $this;
public function getTitle(): string
return $this->title;
public function getDescription(): string
return $this->description;
public function getId(): string
return $this->id;
public function getTag(): string
return $this->tag;
public static function create(array $data): Data
return new static($data);