소스 검색

Refactor: simplified "findFields" function

Maurits van der Schee 8 년 전
부모
커밋
6923a52d27
1개의 변경된 파일2개의 추가작업 그리고 3개의 파일을 삭제
  1. 2
    3
      api.php

+ 2
- 3
api.php 파일 보기

@@ -888,8 +888,7 @@ class REST_CRUD_API {
888 888
 		return $input;
889 889
 	}
890 890
 
891
-	protected function findFields($tables,$collect,$select,$columns,$database,$db) {
892
-		$tables = array_unique(array_merge($tables,array_keys($collect),array_keys($select)));
891
+	protected function findFields($tables,$columns,$database,$db) {
893 892
 		$fields = array();
894 893
 		foreach ($tables as $i=>$table) {
895 894
 			$fields[$table] = $this->findTableFields($table,$database,$db);
@@ -960,7 +959,7 @@ class REST_CRUD_API {
960 959
 
961 960
 		// reflection
962 961
 		list($tables,$collect,$select) = $this->findRelations($tables,$database,$db);
963
-		$fields = $this->findFields($tables,$collect,$select,$columns,$database,$db);
962
+		$fields = $this->findFields($tables,$columns,$database,$db);
964 963
 
965 964
 		// permissions
966 965
 		if ($table_authorizer) $this->applyTableAuthorizer($table_authorizer,$action,$database,$tables);

Loading…
취소
저장