/**
* Get the permalink for first found page associated with a given php template
*
* @param $name the name of the template page file
* @return null if not found, the permalink for the first found page otherwise
*/
static public function getLinkForPageTemplate($name)
{
$page = current(get_posts([
'post_type' => 'page',
'meta_key' => '_wp_page_template',
'meta_value' => $name
]));
return $page ? get_permalink($page->ID) : null;
}
Proposal :