How to use ->getFormatter and ->setFormatter to send a null to the client and to set the column null

How to use ->getFormatter and ->setFormatter to send a null to the client and to set the column null

obrienjobrienj Posts: 93Questions: 38Answers: 0

I have a need to have the server-side always send a null to the client-side for a specific field (column)

How do I do this?

Conversely, how do I use ->setFormatter to force the field (column) to always be set to null in the database?

Regards,
Jim

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,872Questions: 1Answers: 10,527 Site admin
    Answer ✓

    Hi Jim,

    The Field->getValue() method could be used to have it always return null. Although, if it is always going to be null, why return it at all - can you not just treat it as null on the client-side?

    There is also a Field->setValue() method that could be used to force the value to be null.

    The details API for the PHP Field class is available here.

    Allan

This discussion has been closed.