[Typo3-dev] RFC Forms, validation, etc. in 5.0

Elmar Hinz elmar.DOT.hinz at team.MINUS.red.DOT.net
Mon Nov 21 10:22:36 CET 2005


> $row = ....SELECT * FROM table WHERE uid=123
> print $row[$TCA['table']['ctrl']['title']]
> 
> Tomorrow we do:
> 
> $rowObj = new dataObject(table, uid)
> print $rowObj->getTitle()
> 
> The data object can also be used like this:
> 
> $rowObj->setField('title', 'My new title value');


More sytematically it would be:

general:
$rowObj->setField('title', 'My new title value');
$rowObj->getField('title');


special:
$rowObj->setTitle('My new title value');
$rowObj->getTitle();


That is the way JavaBeans do it.

You normally have to hardcode each get and set function.

With function overloading it is possible to automate it:

http://www.php.net/manual/en/language.oop5.overloading.php

It would look like this then:

Setter:

$rowObj->title = 'My new title value';

Getter:

$title = $rowObj->title;

Simple, smart!!!

Some further steps and we come close to the most attractiv features of 
rapid development of ruby on rails.


> 
> Finally it should work the same in frontend and backend.
> 

Great!

Elmar



-- 
Climate change 2005: Mexico, Guatemala, New Orleans, Sahel, Bangladesh,
Spain, Portugal, Austria, Swiss, France, ...
Production of CO2 is killing people.
Production of CO2 just for fun is killing people just for fun.




More information about the TYPO3-dev mailing list