CreatePollCommand.php
622 Bytes
<?php
namespace FootyRoom\App\Poll;
use FootyRoom\App\Command;
class CreatePollCommand extends Command
{
/**
* Consturctor.
*
* @param array $data
*/
public function __construct(array $data = [])
{
if (is_array($data['choices'])) {
foreach ($data['choices'] as $choice) {
$this->choices[] = new Choice($choice);
}
unset($data['choices']);
}
parent::__construct($data);
}
/**
* @var int
*/
public $userId;
/**
* @var \FootyRoom\App\Poll\Choice[]
*/
public $choices;
}