[TYPO3-mvc] Models and logic

Frank Gerards F.Gerards at esolut.de
Mon Apr 16 10:25:25 CEST 2012


Hi,

+1 with TIM...
to be more concrete:
DB-related methods shouldn't be handled by a model imho.

Children of a model are normally referred in a model-property of type Tx_Extbase_...._ObjectStorage.
What exactly do you mean with "state of completion" and "state" ? 

Persistence mechanisms like the persistAll() method are built-in features of extbase.

Greetz,
frank


-----Ursprüngliche Nachricht-----
Von: typo3-project-typo3v4mvc-bounces at lists.typo3.org [mailto:typo3-project-typo3v4mvc-bounces at lists.typo3.org] Im Auftrag von Toke Herkild
Gesendet: Montag, 16. April 2012 10:03
An: typo3-project-typo3v4mvc at lists.typo3.org
Betreff: [TYPO3-mvc] Models and logic

Hi all,

Having started using Extbase, I've come to the following question:

Is it possible to add non DB logic to a model ?

Often when doing a MVC project you often got operations which are not really DB logic, but still is part of the model and not the controller, nor the view, but you need those operations inorder for the view to do the right thing.

EG: if you have a larger relational three, and you need a combined state of it's completion. you'd have to parse through the different states of the model and it's children, and return an array, containing the total state.
ex: this->view->assign('state', $TModel->getState());

Regards
Toke Herkild
_______________________________________________
TYPO3-project-typo3v4mvc mailing list
TYPO3-project-typo3v4mvc at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc


More information about the TYPO3-project-typo3v4mvc mailing list