I have checked the code in the SMWTestStore.php that does the insertion of array data to the query results, I need the same for my project. The problem with it, is that I guess is outdated, so it doesn't work. SMWQueryResult in the following code takes just one parameter, instead of more...
> function getQueryResult( SMWQuery $query ) { > $prs = $query->getDescription()->getPrintrequests(); // ignore > print requests at deepder levels > > // Here, the actual SQL query building and execution must > happen. Loads of work. > // For testing purposes, we assume that the outcome is the > following array of titles > // (the eventual query result format is quite certainly different) > $qr = array( Title::newFromText( 'Angola' ), > Title::newFromText( 'Namibia' ) ); > > // create result by executing print statements for everything > that was fetched > ///TODO: use limit and offset values > $result = new SMWQueryResult( $prs ); > foreach ( $qr as $qt ) { > $row = array(); > foreach ( $prs as $pr ) { > switch ( $pr->getMode() ) { > case SMWPrintRequest::PRINT_THIS: > $row[] = new SMWResultArray( array( $qt ), $pr ); > break; > case SMWPrintRequest::PRINT_CATS: > $row[] = new SMWResultArray( > $this->getSpecialValues( $qt, SMW_SP_INSTANCE_OF ), $pr ); > break; > case SMWPrintRequest::PRINT_PROP: > ///TODO: respect given datavalue (desired > unit), needs extension of getAttributeValues() > $row[] = new SMWResultArray( > $this->getAttributeValues( $qt, $pr->getTitle() ), $pr ); > break; > } > } > $result->addRow( $row ); > } > > return $result; > } ------------------------------------------------------------------------------ Centralized Desktop Delivery: Dell and VMware Reference Architecture Simplifying enterprise desktop deployment and management using Dell EqualLogic storage and VMware View: A highly scalable, end-to-end client virtualization framework. Read more! http://p.sf.net/sfu/dell-eql-dev2dev _______________________________________________ Semediawiki-devel mailing list Semediawiki-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/semediawiki-devel