[TYPO3-mvc] Problems with table mapping
Manfred Rutschmann
manfred.rutschmann at revier.de
Wed Apr 13 14:44:24 CEST 2011
> I am not sure if extbase supports an identity column other than 'uid'
> already. If it does at all I am sure it would need at least proper
> configuration.
>
> Greets,
> Peter
I don`t think that extbase support this. I can patch the dataMapper.php a
little bit to read from a plain table with another identifier as uid:
/**
* Maps a single row on an object of the given class
*
* @param string $className The name of the target class
* @param array $row A single array with field_name => value pairs
* @return object An object of the given class
*/
protected function mapSingleRow($className, array $row) {
if ($this->identityMap->hasIdentifier($row['uid'], $className)) {
$object = $this->identityMap->getObjectByIdentifier($row['uid'],
$className);
} else {
$object = $this->createEmptyObject($className);
$this->identityMap->registerObject($object, $row['uid']);
$this->thawProperties($object, $row);
$object->_memorizeCleanState();
$this->persistenceSession->registerReconstitutedObject($object);
}
return $object;
}
Is there any chance to pathc this function that i can give it the
identifier column by typoscript for each table instead of a hardcoded uid
field?
More information about the TYPO3-project-typo3v4mvc
mailing list