[TYPO3-mvc] fluid paginate widget :: error: "passed argument must implement Tx_Extbase_Persistence_QueryResultInterface"
    Roland 
    most.wanted at gmx.at
       
    Wed Mar 14 16:58:28 CET 2012
    
    
  
hi henjo,
thank you for your answer.
> Does your repository method ends with ->execute()->toArray() ?
>
> The paginator receives an array instead of a query result as the error
> says...
you are right, the EXT:extbase_dam returns the "bilder" (english: 
"images")  as an array.
i guess i will have to fix this in EXT:extbase_dam. maybe someone 
already fixed the class Tx_ExtbaseDam_Utility_Dam?
thanks once again for your help.
kind regards.
roland
--- quote ---
/**
* Will return an array of Tx_ExtbaseDam_Domain_Model_Dam objects for the 
given table/uid/ident combination.
*
* @var string $table The table that dam-records have to be fetched for.
* @var int $uid The UID of the record for which the dam-records have to 
be fetched for.
* @var string $ident The field ident that dam-records have to be fetched 
for.
* @var string $orderBy Any ordering that should be applied.
* @var int $limit The maximum amount of objects to return.
* @return array An array of Dam objects.
*/
public static function get($table, $uid, $ident, $orderBy = '', $limit = 
1000) {
	// check if this exact function call has been made before and give the 
cached result
	if 
(isset(self::$objectStorage['ref'][$table][$uid][$ident][$orderBy][$limit])) 
{
		return 
self::$objectStorage['ref'][$table][$uid][$ident][$orderBy][$limit];
	}
		
	// gets the data from DAM
	$damArray = tx_dam_db::getReferencedFiles($table, $uid, $ident, 
'tx_dam_mm_ref', 'tx_dam.*', array(), '', $orderBy, $limit);
	$rows = $damArray['rows'];
		
	if (count($rows) > 0) {
		// dataMapper is a singleton
		$dataMapper = 
t3lib_div::makeInstance('Tx_Extbase_Persistence_Mapper_DataMapper');
		$objects = $dataMapper->map('Tx_ExtbaseDam_Domain_Model_Dam', $rows);
			
		// cache the function call
		self::$objectStorage['ref'][$table][$uid][$ident][$orderBy][$limit] = 
$objects;
			
		return $objects;
	}
		
	self::$objectStorage['ref'][$table][$uid][$ident][$orderBy][$limit] = 
array();
		
	// no records found
	return array();
}
--- /quote ---
    
    
More information about the TYPO3-project-typo3v4mvc
mailing list