Skip to content

[Technical Debt]: Add getters for protected model variables #4489

@coderabbitai

Description

@coderabbitai

Overview

Add getters for all protected model variables since they are currently being accessed directly, which is not the intended pattern. Making them public is a bad idea because they can be modified in the code unintentionally. They should be changed to private with a getter, then calling code should be refactored to use the getter.

Background

This was identified as a follow-up task from PR #4485 (Update to CodeIgniter 4.7.2).

Tasks

  • Audit all models for protected variables that are being accessed directly from outside the class
  • Change those variables from protected to private
  • Add appropriate getter methods for each variable
  • Refactor all calling code to use the new getters
  • Add tests to verify behavior is unchanged

References

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions