@@ -313,42 +313,6 @@ protected function getData(): array
313313 return $ data ;
314314 }
315315
316- /**
317- * 设置需要附加的输出属性.(视图模型下无效)
318- *
319- * @param array $append 属性列表
320- *
321- * @return $this
322- */
323- public function append (array $ append )
324- {
325- return $ this ;
326- }
327-
328- /**
329- * 设置需要隐藏的输出属性.(视图模型下无效)
330- *
331- * @param array $hidden 属性列表
332- *
333- * @return $this
334- */
335- public function hidden (array $ hidden )
336- {
337- return $ this ;
338- }
339-
340- /**
341- * 设置需要输出的属性.(视图模型下无效)
342- *
343- * @param array $visible
344- *
345- * @return $this
346- */
347- public function visible (array $ visible )
348- {
349- return $ this ;
350- }
351-
352316 /**
353317 * 判断数据是否为空.
354318 *
@@ -438,7 +402,7 @@ public function bindRelationAttr($model, $bind, $relation)
438402 *
439403 * @return array
440404 */
441- protected function convertData (): array
405+ private function convertData (): array
442406 {
443407 // 获取属性映射
444408 $ properties = $ this ->getEntityPropertiesMap ();
@@ -504,7 +468,7 @@ public function scene(string|array $scene)
504468 * @throws ValidateException
505469 * @return bool
506470 */
507- protected function validate (): bool
471+ private function validate (): bool
508472 {
509473 $ validater = $ this ->getOption ('validate ' );
510474 if (!empty ($ validater ) && !$ this ->getOption ('dataHasValidate ' , false )) {
@@ -768,6 +732,11 @@ public static function __callStatic($method, $args)
768732
769733 public function __call ($ method , $ args )
770734 {
735+ if (in_array ($ method , ['hidden ' , 'visible ' , 'append ' ])) {
736+ // 不支持输出设置
737+ return $ this ;
738+ }
739+
771740 // 调用Model类方法
772741 $ result = call_user_func_array ([$ this ->model (), $ method ], $ args );
773742 return $ result instanceof Model ? $ this : $ result ;
0 commit comments