public static function getLinkableType(aohs\AssetOperationHandlerService $service, $id_string) { $types = array(Page::TYPE, File::TYPE, Symlink::TYPE); $type_count = count($types); for ($i = 0; $i < $type_count; $i++) { $id = $service->createId($types[$i], $id_string); $operation = new \stdClass(); $read_op = new \stdClass(); $read_op->identifier = $id; $operation->read = $read_op; $operations[] = $operation; } $service->batch($operations); $reply_array = $service->getReply()->batchReturn; for ($j = 0; $j < $type_count; $j++) { if ($reply_array[$j]->readResult->success == 'true') { foreach (c\T::$type_property_name_map as $type => $property) { if (isset($reply_array[$j]->readResult->asset->{$property})) { return $type; } } } } return "The id does not match any asset type."; }