Ignore:
Timestamp:
11/18/11 11:07:07 (13 years ago)
Author:
jkraaijeveld
Message:

Refactored queries / cleaned up some code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk/classes/SurveyConnector.php

    r149 r158  
    5555        $keys = array_keys($arguments);
    5656        //Set default values for arguments
    57         $uid = "?uid"; $title = "?title"; $description = "?description"; $creator = "?creator"; $questions = "";
     57        $uid = ""; $title = ""; $description = ""; $creator = ""; $questions = "";
    5858        if(in_array("uid", $keys))
    59             $uid = '\''.$arguments["uid"].'\'';
     59            $uid = 'predicates:uid \''.$arguments["uid"].'\'';
    6060        if(in_array("title", $keys))
    61             $title = '\''.$arguments["title"].'\'';
     61            $title = 'predicates:title \''.$arguments["title"].'\'';
    6262        if(in_array("description", $keys))
    63                         $description = "\"".$arguments["description"]."\"";
     63                        $description = "predicates:description \"".$arguments["description"]."\"";
    6464                if(in_array("creator", $keys))
    65                         $creator = "\"".$arguments["creator"]."\"";
     65                        $creator = "predicates:creator \"".$arguments["creator"]."\"";
    6666        if(in_array("questions", $keys))
    6767        {
     
    8383                predicates:uid ?uid ;
    8484                predicates:title ?title ;
    85                 predicates:description ?description ;
    86                 predicates:uid ' . $uid . '
    87                 predicates:title ' . $title . '
    88                                 predicates:description ' . $description . '
    89                                 predicates:creator ' . $creator . '
    90                 ' . $questions . '
     85                                predicates:description ?description ;
     86                                predicates:creator ?creator ;
     87                                ' . $uid . $title . $description . $creator . $questions . '
    9188            }';
    9289       
     
    111108    /**
    112109     * Gets the questions corresponding to the survey
    113      * @param type $uid
     110     * @param type $uid : The uid for which the questions should be gotten.
    114111     */
    115112    private function getQuestions($uid)
     
    143140    /**
    144141     * Saves the given Survey object.
    145      * @param type $rToolObject
     142     * @param type $rToolObject : The ResearchToolObject to be saved.
    146143     */
    147144    public function set($rToolObject)
Note: See TracChangeset for help on using the changeset viewer.