Possible error in "Working with databases" (Yii3 Guide)

I’m trying the code that is in the guide and in the section about working with database I think I found an error.

This is the code that generates the error that does not allow the record to be saved (in the EditAction file):

$id = $isNew ? Uuid::uuid7()->toString() : $page->id;

The reason is that the id column is a binary[16], but the toString() method generates an ASCII string that is longer than 16 chars.

Changing the code to

 $id = $isNew ? Uuid::uuid7()->getBytes() : $page->id;

fixes the problem.
I’m using MySql and not Postresql, but I don’t think this should matter.