77class Space
88{
99 private $ mapper ;
10-
10+
1111 private $ id ;
1212 private $ name ;
1313 private $ format ;
@@ -38,6 +38,8 @@ public function addProperty($name, $type)
3838 $ this ->mapper ->getClient ()->evaluate ("box.space[ $ this ->id ]:format(...) " , [$ format ]);
3939
4040 $ this ->parseFormat ();
41+
42+ return $ this ;
4143 }
4244
4345 public function removeProperty ($ name )
@@ -51,13 +53,17 @@ public function removeProperty($name)
5153 $ this ->format = $ format ;
5254
5355 $ this ->parseFormat ();
56+
57+ return $ this ;
5458 }
5559
5660 public function removeIndex ($ name )
5761 {
5862 $ this ->mapper ->getClient ()->evaluate ("box.space[ $ this ->id ].index. $ name:drop() " );
5963 $ this ->indexes = [];
6064 $ this ->mapper ->getRepository ('_index ' )->flushCache ();
65+
66+ return $ this ;
6167 }
6268
6369 public function createIndex ($ config )
@@ -66,7 +72,7 @@ public function createIndex($config)
6672 if (!is_array ($ config )) {
6773 $ config = ['fields ' => $ config ];
6874 }
69-
75+
7076
7177 if (!array_key_exists ('fields ' , $ config )) {
7278 if (array_values ($ config ) != $ config ) {
@@ -104,6 +110,7 @@ public function createIndex($config)
104110 $ this ->mapper ->getClient ()->evaluate ("box.space[ $ this ->id ]:create_index(' $ name', ...) " , [$ options ]);
105111 $ this ->indexes = [];
106112
113+ return $ this ;
107114 }
108115
109116 public function isSpecial ()
@@ -153,6 +160,7 @@ private function parseFormat()
153160 $ this ->formatTypesHash [$ row ['name ' ]] = $ row ['type ' ];
154161 $ this ->formatNamesHash [$ row ['name ' ]] = $ key ;
155162 }
163+ return $ this ;
156164 }
157165
158166 public function hasProperty ($ name )
@@ -222,7 +230,7 @@ public function castIndex($params)
222230 $ equals = $ equals && in_array ($ part [0 ], $ keys );
223231 }
224232 }
225-
233+
226234 if ($ equals ) {
227235 return $ index ->iid ;
228236 }
@@ -313,4 +321,4 @@ public function getRepository()
313321 }
314322 return $ this ->repository ?: $ this ->repository = new $ class ($ this );
315323 }
316- }
324+ }
0 commit comments