[TYPO3-mvc] Child object values
Matt Janus
janus76uk at googlemail.com
Mon Feb 13 12:54:55 CET 2012
Just realised attachment won't work, so here are some excerpts from the model
class Tx_Modulemarks_Domain_Model_Mark extends
Tx_Extbase_DomainObject_AbstractEntity {
/**
* Overall Grade
*
* @var string
*/
protected $overallGrade;
/**
* Overall Mark
*
* @var string
*/
protected $overallMark;
/**
* Module Details
*
* @var Tx_Modulemarks_Domain_Model_Module
* @lazy
*/
protected $moduleDetail;
/**
* Returns the overallGrade
*
* @return string $overallGrade
*/
public function getOverallGrade() {
return $this->overallGrade;
}
/**
* Returns the overallMark
*
* @return string $overallMark
*/
public function getOverallMark() {
return $this->overallMark;
}
/**
* Returns the moduleDetail
*
* @return Tx_Modulemarks_Domain_Model_Module $moduleDetail
*/
public function getModuleDetail() {
return $this->moduleDetail;
}
}
class Tx_Modulemarks_Domain_Model_Module extends
Tx_Extbase_DomainObject_AbstractValueObject {
/**
* Module Code
*
* @var string
*/
protected $code;
/**
* Returns the code
*
* @return string $code
*/
public function getCode() {
return $this->code;
}
....
}
I hope this helps.
Thanks
Matt
On Mon, Feb 13, 2012 at 11:49 AM, Matt Janus <janus76uk at googlemail.com> wrote:
> I am just starting out with extbase and slowly getting my head around
> it but I am having a problem of access values of child object.
>
> each mark will contain an over all mark, number of question answered
> etc. it will then reference a value object that will contain
> information regarding the module such as module title, module code and
> the number of exam questions for that module.
>
> I have attached the an image to help explain (hopefully it will show up).
>
> In the fluid template I can access the values of the module by -
> {mark.moduledetail.code}
>
> The question I have, is how can I access this value in the mark
> controller? I'm sure its something very simple but it has been driving
> me mad for days.
>
> Any help, or pointers would be most appreciated.
>
> Thanks
>
> Matt
>
> _______________________________________________
> 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