Skip to content

Instantly share code, notes, and snippets.

@kurozumi
Created December 2, 2020 22:38
Show Gist options
  • Save kurozumi/17816d033f31be0f6a2aa79fd1bf6da0 to your computer and use it in GitHub Desktop.
Save kurozumi/17816d033f31be0f6a2aa79fd1bf6da0 to your computer and use it in GitHub Desktop.
アンケート用のエンティティ
<?php
namespace Customize\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* Class Questionnaire
* @package Customize\Entity
*
* @ORM\Table(name="ctm_questionnaire")
* @ORM\HasLifecycleCallbacks()
* @ORM\Entity(repositoryClass="Customize\Repository\QuestionnaireRepository")
*/
class Questionnaire
{
/**
* @var int
*
* @ORM\Column(type="integer", options={"unsigned":true})
* @ORM\Id()
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
/**
* @var string
*
* @ORM\Column(type="string", length=255)
* @Assert\NotBlank(groups={"step1"})
*/
private $q1;
/**
* @var string
*
* @ORM\Column(type="string", length=255)
* @Assert\NotBlank(groups={"step2"})
*/
private $q2;
/**
* @var string
*
* @ORM\Column(type="text", length=255, nullable=true)
*/
private $q3;
/**
* @return string|null
*/
public function getQ1(): ?string
{
return $this->q1;
}
/**
* @param string|null $q1
* @return $this
*/
public function setQ1(?string $q1): self
{
$this->q1 = $q1;
return $this;
}
/**
* @return string|null
*/
public function getQ2(): ?string
{
return $this->q2;
}
/**
* @param string|null $q2
* @return $this
*/
public function setQ2(?string $q2): self
{
$this->q2 = $q2;
return $this;
}
/**
* @return string|null
*/
public function getQ3(): ?string
{
return $this->q3;
}
/**
* @param string|null $q3
* @return $this
*/
public function setQ3(?string $q3): self
{
$this->q3 = $q3;
return $this;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment