/** * Serializer constructor. */ public function __construct() { parent::__construct(); $this->addAttributes('partial', 'context'); $this->fields = array_merge($this->generateFields(), $this->generateAppendedFields()); $this->setFields(); }
/** * After Validation save file. * * @param $value * * @return string */ public function runValidation($value) { /* @var $file File */ $file = parent::runValidation($value); return $this->uploadFile($file); }
/** * @param $data DateTime * * @throws ValidationError */ public function runValidationClause($data) { $data = $data->format($this->outputFormat); return parent::runValidationClause($data); }