本文整理汇总了PHP中Generic::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Generic::get方法的具体用法?PHP Generic::get怎么用?PHP Generic::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Generic
的用法示例。
在下文中一共展示了Generic::get方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: while
}
}
if ($result = $this->db->query($queryMat)) {
while ($row = $result->fetch_assoc()) {
$dataMat[] = $row;
}
}
return array('geometry' => $dataGeometry, 'loading' => $dataLoading, 'support' => $dataSpt, 'material' => $dataMat);
}
}
$get = (object) $_GET;
$request = (object) $_REQUEST;
$post = json_decode(file_get_contents("php://input"));
@($database = !empty($request->database) ? $request->database : $post->database);
$generic = new Generic($database);
$data = $generic->get(104, 'true');
// $data = $generic->get($request->userid, $request->clear);
// die(json_encode($data));
// var_dump($data);
// var_dump($data['geometry']);
$nodes_g = array();
for ($i = 0; $i < sizeof($data['geometry']); $i++) {
if ($i == 0) {
array_push($nodes_g, $data['geometry'][$i]['start']);
array_push($nodes_g, $data['geometry'][$i]['end']);
} else {
array_push($nodes_g, $data['geometry'][$i]['end']);
}
}
print_r($nodes_g);
var_dump($data['loading']);
示例2: placeInExpanded
private static function placeInExpanded($data, array &$nodes, array $expansion_data, $name_property = 'name', $children_property = 'children', $output_type = 'keep_type')
{
$keys = array_keys($expansion_data);
$column = $keys[0];
$data_to_store = array_shift($expansion_data);
$found_node = null;
foreach ($nodes as $node) {
if (Generic::get($node, $name_property) == Generic::get($data, $column)) {
$found_node = $node;
}
}
if ($found_node == null) {
$found_node = array();
$found_node[$name_property] = Generic::get($data, $column);
foreach ($data_to_store as $col) {
$found_node[$col] = Generic::get($data, $col);
}
if (count($expansion_data)) {
$found_node[$children_property] = array();
}
if ($output_type == 'object') {
$found_node = (object) $found_node;
}
$nodes[] = $found_node;
}
if (count($expansion_data)) {
Arrays::placeInExpanded($data, Generic::get($found_node, $children_property), $expansion_data, $name_property, $children_property, $output_type);
}
}