ongr-io /
SettingsBundle
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php |
||
| 2 | |||
| 3 | /* |
||
| 4 | * This file is part of the ONGR package. |
||
| 5 | * |
||
| 6 | * (c) NFQ Technologies UAB <[email protected]> |
||
| 7 | * |
||
| 8 | * For the full copyright and license information, please view the LICENSE |
||
| 9 | * file that was distributed with this source code. |
||
| 10 | */ |
||
| 11 | |||
| 12 | namespace ONGR\SettingsBundle\Document; |
||
| 13 | |||
| 14 | use JsonSerializable; |
||
| 15 | use ONGR\ElasticsearchBundle\Annotation as ES; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Stores admin settings. |
||
| 19 | * |
||
| 20 | * @ES\Document(type="profiles") |
||
| 21 | */ |
||
| 22 | class Profile implements JsonSerializable |
||
| 23 | { |
||
| 24 | /** |
||
| 25 | * @var string |
||
| 26 | * |
||
| 27 | * @ES\Id() |
||
| 28 | */ |
||
| 29 | private $id; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @var string |
||
| 33 | * |
||
| 34 | * @ES\Property(name="name", type="string", options={"analyzer"="standard"}) |
||
| 35 | */ |
||
| 36 | private $name; |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @var string |
||
| 40 | * |
||
| 41 | * @ES\Property(name="description", type="string", options={"analyzer"="standard"}) |
||
| 42 | */ |
||
| 43 | private $description; |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @return string |
||
| 47 | */ |
||
| 48 | public function getId() |
||
| 49 | { |
||
| 50 | return $this->id; |
||
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @param string $id |
||
| 55 | */ |
||
| 56 | public function setId($id) |
||
| 57 | { |
||
| 58 | $this->id = $id; |
||
| 59 | } |
||
| 60 | |||
| 61 | /** |
||
| 62 | * @return string |
||
| 63 | */ |
||
| 64 | public function getName() |
||
| 65 | { |
||
| 66 | return $this->name; |
||
| 67 | } |
||
| 68 | |||
| 69 | /** |
||
| 70 | * @param string $name |
||
| 71 | */ |
||
| 72 | public function setName($name) |
||
| 73 | { |
||
| 74 | $this->name = $name; |
||
| 75 | } |
||
| 76 | |||
| 77 | /** |
||
| 78 | * @return string |
||
| 79 | */ |
||
| 80 | public function getDescription() |
||
| 81 | { |
||
| 82 | return $this->description; |
||
| 83 | } |
||
| 84 | |||
| 85 | /** |
||
| 86 | * @param string $description |
||
| 87 | */ |
||
| 88 | public function setDescription($description) |
||
| 89 | { |
||
| 90 | $this->description = $description; |
||
| 91 | } |
||
| 92 | |||
| 93 | function jsonSerialize() |
||
|
0 ignored issues
–
show
|
|||
| 94 | { |
||
| 95 | return [ |
||
| 96 | 'id' => $this->id, |
||
| 97 | 'name' => $this->name, |
||
| 98 | 'description' => $this->description, |
||
| 99 | ]; |
||
| 100 | } |
||
| 101 | |||
| 102 | } |
||
| 103 |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.