[TYPO3-mvc] Cannot cast object of type "Tx_Extbase_Persistence_QueryResult" to string.

Johannes C. Schulz - EnzephaloN IT-Solutions info at enzephalon.de
Mon Jun 13 10:19:05 CEST 2011


Hi there!

 

Today I have a problem with the error-message:

Cannot cast object of type "Tx_Extbase_Persistence_QueryResult" to string.

 

I think something in my repository is wrong, but I didn't find it:

 

class Tx_EnzTeaserlist_Domain_Repository_TeaseritemRepository extends
Tx_Extbase_Persistence_Repository {

 

      public function givemelist($category,$order,$type,$storage){

            $orderings = array($type => $order == 'ORDER_ASCENDING' ? 

 
Tx_Extbase_Persistence_QueryInterface::ORDER_ASCENDING : 

 
Tx_Extbase_Persistence_QueryInterface::ORDER_DESCENDING);

            if(!empty($storage)) {

                  $pid = $storage;

            }else{

                  $pid = t3lib_div::_GP('id');

            }

            

            $query = $this->createQuery();

            

                  $pidsearch = array();

                  if (!is_array($pid)) {

                        $pidsearch =
$query->logicalOr(array($query->equals('teaseritem.pid',$pid)));

                  }

                  else {

                        $pidsearch =
$query->logicalOr(array($query->in('teaseritem.pid',$pid)));

                  }

            

        if(!empty($pidsearch))
$query->matching($query->logicalAnd($pidsearch));

      $query->setOrderings($orderings);

      return $query->execute();

      }

}

 

Can somebody help me please?

 

Best regards

Johannes



More information about the TYPO3-project-typo3v4mvc mailing list