[TYPO3-mvc] Unable to get pid of Domain Model Object
Christine Gerpheide
cgerpheide at gmail.com
Tue Oct 5 17:24:48 CEST 2010
2010/10/5 Alexander Dick <alex at dick.at>
>
> Hi List,
>
> I am unable to get the pid of a record. In my Model there is the property
> and the corresponding getter:
>
> /**
> * @var integer
> */
> protected $pid;
>
> /**
> * @return integer
> */
> public function getPid() {
> return $this->pid;
> }
>
> but getPid returns always null - what's the problem there?
> getUid works as expected.
>
> Thanks in advance
> Alex
>
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
>
Hi Alex,
If you print_r the object (not using the getter), do you see the pid filled
in at all? If not: You could try adding a column in the TCA. Also, I
recall having a problem with getting the pid of Page objects from the pages
table, and I ended up configuring it explicitly with persistence TS to be
filled in (though I still don't understand why I had to do this):
classes {
Tx_MyExt_Domain_Model_Page {
mapping {
tableName = pages
columns {
pid.mapOnProperty = pid
}
}
}
}
Maybe that helps...
Christine
--
Christine Gerpheide ✈ larissa, greece @ www.pheide.com
More information about the TYPO3-project-typo3v4mvc
mailing list