Module_OOP_ORM_Parse::get_sub_offset_data
null Module_OOP_ORM_Parse::get_sub_offset_data( array/object $data , array $sub_field [, $index = null ] )
参数列表
参数 |
类型 |
描述 |
默认值 |
$data |
array/object |
数组或对象 |
|
$sub_field |
array |
子节点 |
|
$index |
unknown |
|
null |
File: ./modules/oop/orm/parse.class.php
1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 | public static function get_sub_offset_data( $data , array $sub_field , $index =null)
{
if ( ! is_array ( $data ) && ! is_object ( $data ) ) return null;
foreach ( $sub_field as $key )
{
if ( is_object ( $data ) )
{
if ( isset( $data -> $key ) )
{
$data = $data -> $key ;
}
else
{
return null;
}
}
else
{
if ( isset( $data [ $key ]) )
{
$data = $data [ $key ];
}
else
{
return null;
}
}
}
return $data ;
}
|