[TYPO3-dev] tsLib_CObj::getSubpart or $this->cObj->getSubpart

Dmitry Dulepov dmitry.dulepov at gmail.com
Fri Nov 7 16:21:36 CET 2008


Hi!

Martin Holtz wrote:
> i saw in some extensions, that they use
> 
> tsLib_CObj::functionName
> 
> instead of $this->cObj->functionName
> 
> What is the recommended way to do so?

Depends on the function. Generally $this->cObj->function.

> And i want to set the $this->cObj->data - Array, so i could use it with
> TypoScript Objects.
> 
> is that the correct way to handle that:
> 
> foreach (xy as $myData) {
> 	$this->cObj->setParent($myData,'mytable:'.$myData['uid']);
> }

No because it will replace current data in the cObject. Instead
create another cObject:

$cObj = t3lib_div::makeInstance('tslib_cObj');
$cObj->start($myData, $tableName);

-- 
Dmitry Dulepov
TYPO3 translations support
My TYPO3 book: http://www.packtpub.com/typo3-extension-development/book
In the blog:
http://typo3bloke.net/post-details/max_os_x_use_php_help_in_chm_format/




More information about the TYPO3-dev mailing list