id; } /** * @return SurveyTemplateElementL11n * * @since 1.0.0 */ public function getL11n() : SurveyTemplateElementL11n { return $this->l11n ?? new NullSurveyTemplateElementL11n(); } /** * Set l11n * * @param SurveyTemplateElementL11n $l11n Template l11n * @param string $lang Language * * @return void * * @since 1.0.0 */ public function setL11n(SurveyTemplateElementL11n $l11n, string $lang = ISO639x1Enum::_EN) : void { $this->l11n = $l11n; } /** * @param SurveyTemplateLabelL11n $label Label * * @return void * * @since 1.0.0 */ public function addLabel(SurveyTemplateLabelL11n $label) : void { $this->labels[] = $label; } /** * @return array * * @since 1.0.0 */ public function getLabels() : array { return $this->labels; } /** * @param mixed $value Label value * * @return void * * @since 1.0.0 */ public function addValue($value) : void { $this->values[] = $value; } /** * @return array * * @since 1.0.0 */ public function getValues() : array { return $this->values; } /** * {@inheritdoc} */ public function toArray() : array { return [ 'id' => $this->id, 'type' => $this->type, 'isOptional' => $this->isOptional, 'order' => $this->order, 'template' => $this->template, 'labels' => $this->labels, 'values' => $this->values, ]; } /** * {@inheritdoc} */ public function jsonSerialize() { return $this->toArray(); } }