{"record":{"id":"d17ea1abf2db8b82","repo":"phalcon/cphalcon","slug":"the-option-field-is-required-d17ea1","errorCode":null,"errorMessage":"The option 'field' is required","messagePattern":"The option 'field' is required","errorType":"exception","errorClass":"Phalcon\\Mvc\\Model\\Behavior\\Exceptions\\MissingRequiredOption","httpStatus":null,"severity":"error","filePath":"phalcon/Mvc/Model/Behavior/Timestampable.zep","lineNumber":51,"sourceCode":"\n        /**\n         * Check if the developer decided to take action here\n         */\n        if this->mustTakeAction(type) !== true {\n            return null;\n        }\n\n        let options = this->getOptions(type);\n\n        if typeof options != \"array\" {\n            return;\n        }\n\n        /**\n         * The field name is required in this behavior\n         */\n        if unlikely !fetch field, options[\"field\"] {\n            throw new MissingRequiredOption(\"field\");\n        }\n\n        let timestamp = this->getTimestamp(options);\n\n        /**\n         * Assign the value to the field, use writeAttribute() if the property\n         * is protected\n         */\n        if unlikely typeof field == \"array\" {\n            for singleField in field {\n                model->writeAttribute(singleField, timestamp);\n            }\n        } else {\n            model->writeAttribute(field, timestamp);\n        }\n    }\n\n    private function getTimestamp(array options)","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/phalcon/cphalcon/blob/b7419de9cd0a8a3f48441ead84c9f8415d463e25/phalcon/Mvc/Model/Behavior/Timestampable.zep#L33-L69","documentation":"Error \"The option 'field' is required\" thrown in phalcon/cphalcon.","triggerScenarios":"Thrown at phalcon/Mvc/Model/Behavior/Timestampable.zep:51 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b7419de9cd0a8a3f48441ead84c9f8415d463e25","analyzedAt":"2026-08-21T06:21:18.811Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}