Get select max of a varchar field in cakephp 4

I have a table where I save a period as yyyy-mm, this period is a varchar field, when I want to get the max of that field with $periodMax = $this->Contributions->find('all')->where(['enterprise_id' => $this->enterprise_id])->select(['period' => $queryMax->func()->max('period')])->first(); it only returns the year without the month, how can I do to get the whole value of that field?
This is what it shows debug($periodMax):

APP/Controller\ContributionsController.php (line 174)
object(App\Model\Entity\Contribution) id:0 {
  'period' => (float) 2024
  '[new]' => false
  '[accessible]' => [
    'enterprise_id' => true,
    'sword_declaration_number' => true,
    'period' => true,
    'created' => true,
    'modified' => true,
    'enterprise' => true,
    'affiliates_contributions' => true,
  ]
  '[dirty]' => [
  ]
  '[original]' => [
  ]
  '[virtual]' => [
  ]
  '[hasErrors]' => false
  '[errors]' => [
  ]
  '[invalid]' => [
  ]
  '[repository]' => 'Contributions'
}

For some reason, it thinks that period is a float. You might have to do that thing where you tell the ORM what type something is, if it’s guessing wrong. (I don’t remember how that works; I’ve rarely if ever needed it.)

Use the second argument of the max() function to specify the return type, by default it’s float.

->max('period', ['string'])