+ def name_links_for object=nil
+ if !@name_links_cache or !@name_links_cache[object.uuid]
+ @name_links_cache ||= {}
+ uuids = @objects.collect(&:uuid) + [object.uuid] - @name_links_cache.keys
+ uuids.each do |uuid|
+ @name_links_cache[uuid] = []
+ end
+ offset = 0
+ while true
+ name_links = Link.
+ filter([['link_class', '=', 'name'],
+ ['head_uuid', 'in', uuids]]).
+ offset(offset).
+ order(['uuid'])
+ name_links.each do |link|
+ @name_links_cache[link.head_uuid] << link
+ end
+ offset += name_links.result_limit
+ break if offset >= name_links.items_available
+ end
+ end
+ @name_links_cache[object.uuid] || []
+ end
+