[TYPO3-50-general] Magic Get too magic?

Robert Lemke robert at typo3.org
Fri Feb 23 10:22:30 CET 2007

Hi Jörg,

Am 23.02.2007 um 10:08 schrieb Joerg Sprung:

> the appreciation for __get and __set is to set and get attributes  
> which
> are not known in class. You never should use this magic to get and set
> well known attributes in class.

Well, our colleagues from ezSystems use __get and __set frequently  
for provding read-only or write-only access to properties (and they  
are not what you call a beginner in terms of PHP and coding). That's  
why phpDocumentor introduced the tags @property-read and @property- 
write so magic properties can be documented.

Imagine you write a class which contains 20 properties. You'd have to  
write 40 Setter / Getter methods.

Anyway, I agree with Thomas, Elmars and your arguments, so I'll  
remove the magic functions from the TYPO3 class.


More information about the TYPO3-project-5_0-general mailing list