field = $field; // Ensure that everything is assigned properly by calling the parent constructor parent::__construct($message, $code, $previous); } public function getInvalidField() { return $this->field; } }