Skip to content

Instantly share code, notes, and snippets.

@ianbarber
Created February 22, 2014 11:54
Show Gist options
  • Save ianbarber/9152784 to your computer and use it in GitHub Desktop.
Save ianbarber/9152784 to your computer and use it in GitHub Desktop.
<?php
namespace Quiz;
use Symfony\Component\HttpFoundation\Request;
class Answer {
public $userid;
public $questionid;
public $country;
public $correct;
public $writetime;
public function __construct() {
$this->writetime = time();
}
public function getProperties() {
$props = array();
$props['userid'] = new \Google_Service_Datastore_Property();
$props['userid']->setStringValue($this->userid);
$props['questionid'] = new \Google_Service_Datastore_Property();
$props['questionid']->setIntegerValue($this->questionid);
$props['country'] = new \Google_Service_Datastore_Property();
$props['country']->setStringValue($this->country);
$props['correct'] = new \Google_Service_Datastore_Property();
$props['correct']->setStringValue($this->correct);
$props['writetime'] = new \Google_Service_Datastore_Property();
$props['writetime']->setDateTimeValue(date("c", $this->writetime));
return $props;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment