Home › Forums › Back End › Not getting it? › Reply To: Not getting it?
September 17, 2014 at 1:06 pm
#183410
Participant
Sorry, I used the method name from Alen’s example (but copied the class definition from yours). Fixed.
edit
I usually name “getter” and “setter” methods get{propertyName}
and set{propertyName}
, just to make their purpose obvious.
Also, if you decide to use private (or protected) properties or methods, it is a very common convention to start their name with an underscore (i.e., $_name
instead of $name
). Again, it just keeps things easy to read and understand.