[TYPO3-mvc] own widget.paginate and f.widget.paginate throws error

Johannes C. Schulz - EnzephaloN IT-Solutions info at enzephalon.de
Fri Jun 17 14:25:08 CEST 2011


Hello

 

Back on my extension, I run from one error to another.

 

My Repository looks like:

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

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

                  Tx_Extbase_Persistence_QueryInterface::ORDER_ASCENDING : 

                  Tx_Extbase_Persistence_QueryInterface::ORDER_DESCENDING);

            if(empty($storage)) {

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

            }

            $query = $this->createQuery();

            $pidsearch = array();

            if (!is_array($storage)) {

                  $pidsearch = $query->equals('pid',$storage);

            }

            else {

                  $pidsearch = $query->in('pid',$storage);

            }

            $query->matching($pidsearch);

            $query->getQuerySettings()->setReturnRawQueryResult(true);

            $query->getQuerySettings()->setRespectStoragePage(false);

            $query->getQuerySettings()->setRespectEnableFields(true);

            $query->getQuerySettings()->setRespectSysLanguage(true);

            $query->setOrderings($orderings);

            

          return $query->execute();

      }

 

The Viewhelper is:

class Tx_EnzTeaserlist_ViewHelpers_Widget_PaginateViewHelper extends
Tx_Fluid_Core_Widget_AbstractWidgetViewHelper {

 

    /**

     * @var
Tx_EnzTeaserlist_ViewHelpers_Widget_Controller_PaginateController

     */

    protected $controller;

 

    /**

     * @param
Tx_EnzTeaserlist_ViewHelpers_Widget_Controller_PaginateController
$controller

     * @return void

     */

    public function
injectController(Tx_EnzTeaserlist_ViewHelpers_Widget_Controller_PaginateCont
roller $controller) {

        $this->controller = $controller;

    }

 

    /**

     *

     * @param Tx_Extbase_Persistence_QueryResultInterface $objects

     * @param string $as

     * @param array $configuration

     * @return string

     */

    public function render(Tx_Extbase_Persistence_QueryResultInterface
$objects, $as, array $configuration = array('itemsPerPage' => 10,
'insertAbove' => FALSE, 'insertBelow' => TRUE)) {

        return $this->initiateSubRequest();

    }

 

}

 

 

The error:

#1: PHP Catchable Fatal Error: Argument 1 passed to
Tx_EnzTeaserlist_ViewHelpers_Widget_PaginateViewHelper::render() must
implement interface Tx_Extbase_Persistence_QueryResultInterface, string
given in
D:\xampp\htdocs\weimar.de\typo3conf\ext\enz_teaserlist\Classes\ViewHelpers\W
idget\PaginateViewHelper.php line 30

 

Whats wrong with my returned query?

 

Thanks

Johannes



More information about the TYPO3-project-typo3v4mvc mailing list