| 1 | <?php |
||
| 13 | class UserObject |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * @var int |
||
| 17 | * |
||
| 18 | * @Property(type="integer") |
||
| 19 | */ |
||
| 20 | public $id; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @var string |
||
| 24 | * |
||
| 25 | * @Property( |
||
| 26 | * type="string", |
||
| 27 | * options={ |
||
| 28 | * "fields":{ |
||
| 29 | * "raw":{"type":"string", "index":"not_analyzed"}, |
||
| 30 | * "folded":{"type":"string", "analyzer":"folding"}, |
||
| 31 | * "value":{"type":"string"} |
||
| 32 | * } |
||
| 33 | * } |
||
| 34 | * ) |
||
| 35 | */ |
||
| 36 | public $username; |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Set data. |
||
| 40 | * |
||
| 41 | * @param UserInterface $user |
||
| 42 | * |
||
| 43 | * @return $this |
||
| 44 | */ |
||
| 45 | public function setData(UserInterface $user) |
||
| 52 | |||
| 53 | /** |
||
| 54 | * Return username slug. |
||
| 55 | * |
||
| 56 | * @param string $fallback |
||
| 57 | * |
||
| 58 | * @return string |
||
| 59 | */ |
||
| 60 | public function getSlug($fallback = 'user') |
||
| 64 | |||
| 65 | /** |
||
| 66 | * {@inheritdoc} |
||
| 67 | */ |
||
| 68 | public function __toString() |
||
| 72 | } |
||
| 73 |