function node_import_extract_property in Node import 6
Get a property from each element of an array.
Parameters
$array: Array of ($key => $info).
$property: String.
Return value
Array of ($key => $info->$property).
Related topics
10 calls to node_import_extract_property()
- book_node_import_defaults in supported/
book.inc - Implementation of hook_node_import_defaults().
- node_import_add_form in ./
node_import.admin.inc - Creates a new import task by letting the user fill in a wizard.
- node_import_check_book_reference in supported/
book.inc - Check whether the value is a book (by NID or Title).
- node_import_list_files_form in ./
node_import.admin.inc - node_import_task_details in ./
node_import.admin.inc
File
- ./
node_import.inc, line 1480 - Public API of the Node import module.
Code
function node_import_extract_property($array, $property = 'title') {
$result = array();
foreach ((array) $array as $key => $info) {
if (is_array($info) || is_object($info)) {
$info = (array) $info;
$result[$key] = isset($info[$property]) ? $info[$property] : '';
}
else {
$result[$key] = $info;
}
}
return $result;
}