Completed
Pull Request — 5.0 (#2163)
by Kevin
13:16
created

TextFormSubmissionField.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace Kunstmaan\FormBundle\Entity\FormSubmissionFieldTypes;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Kunstmaan\FormBundle\Entity\FormSubmissionField;
7
8
use Kunstmaan\FormBundle\Form\TextFormSubmissionType;
9
10
/**
11
 * The TextFormSubmissionField can be used to store multi-line string values to a FormSubmission
12
 *
13
 * @ORM\Entity
14
 * @ORM\Table(name="kuma_text_form_submission_fields")
15
 */
16 View Code Duplication
class TextFormSubmissionField extends FormSubmissionField
0 ignored issues
show
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
17
{
18
19
    /**
20
     * @ORM\Column(name="tfsf_value", type="text")
21
     */
22
    protected $value;
23
24
    /**
25
     * Return the current string value
26
     *
27
     * @return string
28
     */
29
    public function getValue()
30
    {
31
        return $this->value;
32
    }
33
34
    /**
35
     * Sets the string value for this FormSubmissionField
36
     *
37
     * @param string $value
38
     *
39
     * @return TextFormSubmissionField
40
     */
41
    public function setValue($value)
42
    {
43
        $this->value = $value;
44
45
        return $this;
46
    }
47
48
    /**
49
     * Returns the default form type for this FormSubmissionField
50
     *
51
     * @return string
52
     */
53
    public function getDefaultAdminType()
54
    {
55
        return TextFormSubmissionType::class;
56
    }
57
58
    /**
59
     * Returns a string representation of this FormSubmissionField
60
     *
61
     * @return string
62
     */
63
    public function __toString()
64
    {
65
        $value = $this->getValue();
66
67
        return !empty($value) ? $value : "";
68
    }
69
70
}
71