コード例 #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 getConnection()
 {
     if (is_null($this->connection)) {
         $this->connection = $this->mapper->getConnection($this);
     }
     return $this->connection;
 }
コード例 #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);
 }
コード例 #5
0
 private function generateObjectCollection()
 {
     $dataObject = new Account();
     return $this->mapper->find($dataObject);
 }