コード例 #1
0
 /**
  * @depends testConstruction
  */
 public function testRegisterMap(ObjectMapper $mapper)
 {
     $mapper->registerMap(new AccountMap(), $this->connection);
     $mapper->registerMap(new CharacterMap(), $this->connection);
     $mapRegistry = TestHelper::getObjProp($mapper, 'mapRegistry');
     $this->assertArrayHasKey('DreamblazeNet\\CrazyDataMapper\\Tests\\Objects\\Account', $mapRegistry);
     $this->assertArrayHasKey('DreamblazeNet\\CrazyDataMapper\\Tests\\Objects\\Character', $mapRegistry);
 }
コード例 #2
0
 private function generateMapper()
 {
     $connection1 = new \DreamblazeNet\CrazyDataMapper\Database\PdoDatabaseConnection(null);
     $conn = $this->getConnection();
     $connection1->setConnection($conn->getConnection());
     $connection2 = new \DreamblazeNet\CrazyDataMapper\Database\PdoDatabaseConnection(null);
     $connection2->setConnection($this->getConnection()->getConnection());
     $mapper = new ObjectMapper();
     $mapper->registerMap(new AccountMap(), $connection1);
     $mapper->registerMap(new CharacterMap(), $connection2);
     $mapper->registerMap(new GuildMembershipMap(), $connection2);
     $mapper->registerMap(new GuildMap(), $connection2);
     $this->mapper = $mapper;
 }
コード例 #3
0
 private function initMapper()
 {
     $this->mapper = new ObjectMapper();
     $this->mapper->registerMap(new AccountMap(), $this->connection);
     $this->mapper->registerMap(new CharacterMap(), $this->connection);
     $this->mapper->registerMap(new GuildMembershipMap(), $this->connection);
     $this->mapper->registerMap(new GuildMap(), $this->connection);
 }
コード例 #4
0
 private function generateObjectCollection()
 {
     $this->connection = new DummyDatabaseConnection('blub', 'testUser', 'testPass');
     $this->mapper = new ObjectMapper();
     $dataObject = new Dummy();
     $this->mapper->registerMap(new DummyMap(), $this->connection);
     $this->mapper->registerMap(new MinionMap(), $this->connection);
     return $this->mapper->find($dataObject);
 }