[TYPO3-mvc] Problems in fetching database records

dennis ahrens dennis.ahrens at googlemail.com
Thu Feb 4 12:11:52 CET 2010


Hi Aravind,

usually fields in your DB using underscores were mapped to CamelCase
in your model.
In your case this means DB-field called person_name will result the
property: protected $personName.

regards
Dennis

2010/2/4 PIT Solutions <typo3 at pitsolutions.com>:
> Hi Franz,
>
>       The below php code is used in typo3conf/ext/pitlist/Classes/Domain/Model/Pit.php.
>
>              class Tx_Pitlist_Domain_Model_Pit extends Tx_Extbase_DomainObject_AbstractEntity {
>
> /**
>  *
>  *
>  * @var string
>  * @identity
>  */
> protected $person_name= ' ';
>    /**
>  * An empty constructor - fill it as you like
>  *
>  */
> public function __construct() {
> }
> /**
>  * Sets the Person name
>  *
>  * @param string $person_name
>  * return void
>  */
> public function setPerson_Name($person_name) {
> $this->person_name = $person_name;
> }
> /**
>  * Gets the Person name
>  *
>  * @return string Person name
>  */
> public function getPerson_Name() {
> return $this->person_name;
> }
> }
>
>
> Earlier the functions used was public function setName($person_name) and public function getName(). Tried with both naming conventions, but invain.
>
>>Try {pit.personName} in your template.
>  The field used is  'person_name' in db table tx_pitlist_domain_model_pit
>
>
> Regards,
> Aravind
>
>
>
>
>
> ----- Original Message ----
> From: Franz Koch <typo3.RemoveForMessage at elements-net.de>
> To: typo3-project-typo3v4mvc at lists.typo3.org
> Sent: Thu, February 4, 2010 3:38:02 PM
> Subject: Re: [TYPO3-mvc] Problems in fetching database records
>
> Hi "unknown",
>
>
> Ok, so the objects are available. That means that your Pit model either has not "getPerson_Name()" method or you simply use the wrong attribute in your template  (which I assume).
>
> Try {pit.personName} in your template.
>
> -- kind regards,
> Franz Koch
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
> _______________________________________________
> 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