Browse Source

Refactor: simplified "findFields" function

Maurits van der Schee 8 years ago
parent
commit
6923a52d27
1 changed files with 2 additions and 3 deletions
  1. 2
    3
      api.php

+ 2
- 3
api.php View File

888
 		return $input;
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
 		$fields = array();
892
 		$fields = array();
894
 		foreach ($tables as $i=>$table) {
893
 		foreach ($tables as $i=>$table) {
895
 			$fields[$table] = $this->findTableFields($table,$database,$db);
894
 			$fields[$table] = $this->findTableFields($table,$database,$db);
960
 
959
 
961
 		// reflection
960
 		// reflection
962
 		list($tables,$collect,$select) = $this->findRelations($tables,$database,$db);
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
 		// permissions
964
 		// permissions
966
 		if ($table_authorizer) $this->applyTableAuthorizer($table_authorizer,$action,$database,$tables);
965
 		if ($table_authorizer) $this->applyTableAuthorizer($table_authorizer,$action,$database,$tables);

Loading…
Cancel
Save