Ejemplo n.º 1
0
            $voterId = $row['Voter_id'];
            $effect = $row['effect'];
            $voterEffect = array("actionId" => $actionId, "voterId" => $voterId, "effect" => $effect);
            $ret[] = $voterEffect;
        }
        $statement->close();
        $db->close();
        return $ret;
    }
    function getJsonData()
    {
        $data = array();
        $data["ActionTypes"] = $this->getActionTypes();
        $data["Actions"] = $this->getActions();
        $data["TargetedActions"] = $this->getTargetedActions();
        $data["ForkedActions"] = $this->getForkedActions();
        $data["ActionTriggers"] = $this->getActionTriggers();
        $data["StartingActions"] = $this->getStartingActions();
        $data["Candidates"] = $this->getCandidates();
        $data["Demographics"] = $this->getDemographics();
        $data["Donors"] = $this->getDonor();
        $data["DonorEffects"] = $this->getDonorEffect();
        $data["States"] = $this->getState();
        $data["Voters"] = $this->getVoter();
        $data["VoterEffects"] = $this->getVoterEffect();
        sendResponse(200, json_encode($data));
    }
}
$factory = new EntityFactory();
$factory->getJsonData();