Concat with ifnull

How do I make Cakephp to concatenate 2 last names? Depending on whether you have a last name, two last names or no last name, I have tried this without success

$apellidos = $personas->func()->concat([
                  'if(Personas.primer_apellido is null, '', concat(Personas.primer_apellido,' ')' => 'identifier',
                  'if(Personas.segundo_apellido is null, '', concat(' ',Personas.primer_apellido)' => 'identifier']);

possible results:

$apellidos = primer_apellido segundo_apellido;
$apellidos =  primer_apellido;
$apellidos =  segundo_apellido;
$apellidos =  null;

Use virtual field: