public function setMetadata($metadataValues) { $this->deleteRecords(); foreach ($metadataValues as $key => $value) { $m = new MetadataValue($this->arguments[0], $key); $m->setMetadataKey($key); $m->setMetadataValue($value); $m->setGameId($this->arguments[0]); $m->commit(); } }
public function setUp() { parent::setUp(); LudoDBRegistry::set('FILE_UPLOAD_PATH', '/tmp/'); $mv = new MetadataValue(); $mv->drop()->yesImSure(); $m = new Move(); $m->drop()->yesImSure(); $g = new Game(); $g->drop()->yesImSure(); $g->createTable(); $m->createTable(); $mv->createTable(); $db = new Database(1); if (!$db->getId()) { $db->setTitle('My database'); $db->commit(); } }
private function createGameMetadata($gameId, $key, $value) { // given $game = new Game($gameId); if (!$game->getId()) { $game->setValues(array("id", $gameId, "white" => "Alf")); $game->commit(); } $m = new MetadataValue($key); // when $m->setGameid($gameId); $m->setMetadataKey($key); $m->setMetadataValue($value); $m->commit(); }