How to set title from page-template?

I am guessing that $dataAccess is instantiated as a global. If that is true, this code…

$slug = $location = htmlspecialchars(urldecode(get_query_var('slug')));
$office = $dataAccess->getProfile($slug);

… should also work in a wp_title callback. You’d just need global $dataAccess; to pull the variable into scope, though there are probably more elegant ways to do it.