{"record":{"id":"9c6ea20d879528bd","repo":"phalcon/cphalcon","slug":"the-option-field-is-required","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/SoftDelete.zep","lineNumber":51,"sourceCode":"\n        if type !== \"beforeDelete\" {\n            return;\n        }\n\n        let options = this->getOptions();\n\n        /**\n         * 'value' is the value to be updated instead of delete the record\n         */\n        if unlikely !fetch value, options[\"value\"] {\n            throw new MissingRequiredOption(\"value\");\n        }\n\n        /**\n         * 'field' is the attribute to be updated instead of delete the record\n         */\n        if unlikely !fetch field, options[\"field\"] {\n            throw new MissingRequiredOption(\"field\");\n        }\n\n        /**\n         * Skip the current operation\n         */\n        model->skipOperation(true);\n\n        /**\n         * If the record is already flagged as 'deleted' we don't delete it again\n         */\n        if model->readAttribute(field) === value {\n            return;\n        }\n\n        let modelsManager = model->getModelsManager();\n\n        /**\n         * Clone the current model to make a clean new operation","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/phalcon/cphalcon/blob/b7419de9cd0a8a3f48441ead84c9f8415d463e25/phalcon/Mvc/Model/Behavior/SoftDelete.zep#L33-L69","documentation":"Error \"The option 'field' is required\" thrown in phalcon/cphalcon.","triggerScenarios":"Thrown at phalcon/Mvc/Model/Behavior/SoftDelete.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"}