Skip to main content
edited tags
Link
carlcs
  • 36.3k
  • 5
  • 63
  • 140
Source Link

Do field values get serialized before validation?

I am learning to write my first plugin for Craft CMS 3.x

I have a field that gets displayed as a string, but is stored in the database as binary. When I validate it, I write:

public function getElementValidationRules(): array
{
    return [
        /* Other rules, */
        ['unique']
    ];
}

What I wonder is, will it get compared in its string form to the binary? Or will serializeValue() get called?