* fix for return fields.

This commit is contained in:
王怡栋
2021-10-26 16:18:35 +08:00
parent 001ca0ef8f
commit 089a1204f1
3 changed files with 4 additions and 2 deletions
+2
View File
@@ -532,10 +532,12 @@ class baseEntry
public function filterFields($object, $allowable = '')
{
if(empty($allowable)) return $object;
if(is_string($allowable)) $allowable = explode(',', $allowable);
$filtered = new stdclass();
foreach($allowable as $field)
{
$field = trim($field);
if(!isset($object->$field)) continue;
$filtered->$field = $object->$field;
}