function deploy_uuid_get_key in Deploy - Content Staging 6
Return the unique key of an item, given its UUID.
I need to come up with a new way to manage this. I am torn by the desire to have a single generic function to manage this, and the desire to not have so many parameters that you may as well just build the SQL yourself. However, the whole if/then to get around nodes vs other content types is ugly too so I don't know.
Return value
array Array with the uuid, key, and possibly also a changed date depending on the type of information requested.
2 calls to deploy_uuid_get_key()
- deploy_uuid_service_get_book in modules/
deploy_uuid/ deploy_uuid_service.inc - deploy_uuid_service_get_key in modules/
deploy_uuid/ deploy_uuid_service.inc
File
- modules/
deploy_uuid/ deploy_uuid.module, line 337 - Deployment UUID management
Code
function deploy_uuid_get_key($uuid, $module) {
// Nodes return their changed date along with their identifying information
// to give node_deploy() information to judge whether or not a dependency
// should be pushed.
if ($module == 'node') {
$result = db_query("SELECT n.nid, u.uuid, n.changed FROM {node} n INNER JOIN {node_uuid} u ON n.nid = u.nid WHERE u.uuid = '%s'", $uuid);
}
else {
$result = db_query("SELECT * FROM {%s} WHERE uuid = '%s'", $module . '_uuid', $uuid);
}
return db_fetch_array($result);
}