11<?php
22
33
4- use Briedis \ApiBuilder \StructureInterface ;
54use Briedis \ApiBuilder \StructureBuilder ;
5+ use Briedis \ApiBuilder \StructureInterface ;
66
7- class UserStructure implements StructureInterface{
8- /**
9- * Get User structure object
10- * @return StructureBuilder
11- */
12- public function getStructure (){
13- return (new StructureBuilder ('User ' ))
14- ->int ('id ' , 'Unique identifier ' )
15- ->str ('username ' , 'Nickname that will be used in the system ' )
16- ->str ('firstName ' , 'Users first name ' )
17- ->str ('lastName ' , 'Users last name ' )
18- ->str ('gender ' , 'M - male, F - female ' )->values (['M ' , 'F ' ])->optional ()
19- ->int ('signature ' , 'Provide your favorite quote or something, if you want ' )->optional ()
20- ->struct ('location ' , new LocationStructure , 'Location object for the user ' )->optional ()
21- ->int ('createdAt ' , 'Unix timestamp, when user has registered ' );
22- }
7+ class UserStructure implements StructureInterface
8+ {
9+ /**
10+ * Get User structure object
11+ * @return StructureBuilder
12+ */
13+ public function getStructure ()
14+ {
15+ return (new StructureBuilder ('User ' ))
16+ ->int ('id ' , 'Unique identifier ' )
17+ ->str ('username ' , 'Nickname that will be used in the system ' )
18+ ->str ('firstName ' , 'Users first name ' )
19+ ->str ('lastName ' , 'Users last name ' )
20+ ->str ('gender ' , 'M - male, F - female ' )->values (['M ' , 'F ' ])->optional ()
21+ ->int ('signature ' , 'Provide your favorite quote or something, if you want ' )->optional ()
22+ ->struct ('location ' , new LocationStructure , 'Location object for the user ' )->optional ()
23+ ->int ('createdAt ' , 'Unix timestamp, when user has registered ' );
24+ }
2325}
0 commit comments