* code for task #43347.
This commit is contained in:
@@ -486,6 +486,8 @@ class baseEntry
|
||||
$type = $field[1];
|
||||
$isArray = false;
|
||||
|
||||
if(!isset($object->$key)) continue;
|
||||
|
||||
$pos = strpos($type, ']');
|
||||
if($pos !== FALSE)
|
||||
{
|
||||
@@ -519,6 +521,28 @@ class baseEntry
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter fields.
|
||||
*
|
||||
* @param object $object
|
||||
* @param array $filters
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function filterFields($object, $allowable = '')
|
||||
{
|
||||
if(empty($allowable)) return $object;
|
||||
|
||||
$filtered = new stdclass();
|
||||
foreach($allowable as $field)
|
||||
{
|
||||
if(!isset($object->$field)) continue;
|
||||
$filtered->$field = $object->$field;
|
||||
}
|
||||
|
||||
return $filtered;
|
||||
}
|
||||
|
||||
/**
|
||||
* 类型转换.
|
||||
* Typecasting.
|
||||
|
||||
Reference in New Issue
Block a user