| 1 | <?php |
||
| 22 | class UserObject |
||
| 23 | { |
||
| 24 | /** |
||
| 25 | * @var int |
||
| 26 | * |
||
| 27 | * @Property(type="integer") |
||
| 28 | */ |
||
| 29 | public $id; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @var string |
||
| 33 | * |
||
| 34 | * @Property( |
||
| 35 | * type="string", |
||
| 36 | * options={ |
||
| 37 | * "fields":{ |
||
| 38 | * "raw":{"type":"string", "index":"not_analyzed"}, |
||
| 39 | * "folded":{"type":"string", "analyzer":"folding"}, |
||
| 40 | * "value":{"type":"string"} |
||
| 41 | * } |
||
| 42 | * } |
||
| 43 | * ) |
||
| 44 | */ |
||
| 45 | public $username; |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Set data. |
||
| 49 | * |
||
| 50 | * @param UserInterface $user |
||
| 51 | * |
||
| 52 | * @return $this |
||
| 53 | */ |
||
| 54 | public function setData(UserInterface $user) |
||
| 61 | |||
| 62 | /** |
||
| 63 | * Return username slug. |
||
| 64 | * |
||
| 65 | * @param string $fallback |
||
| 66 | * |
||
| 67 | * @return string |
||
| 68 | */ |
||
| 69 | public function getSlug($fallback = 'user') |
||
| 73 | |||
| 74 | public function __toString() |
||
| 78 | } |
||
| 79 |