예제 #1
0
 public function testGets()
 {
     $raw = ['table' => 'someTable', 'patch' => 'somePatch', 'install' => 'someInstall'];
     $install = new Install($raw);
     $this->assertEquals(null, $install->getId());
     $this->assertEquals(1234, $install->getId(1234));
     $this->assertEquals($raw['table'], $install->getTable());
     $this->assertEquals($raw['patch'], $install->getPatch());
     $this->assertEquals($raw['install'], $install->getInstall());
     $this->assertEquals($raw, $install->dump());
 }
예제 #2
0
 public function updateInstall(Install $originalInstall, Install $newInstall)
 {
     $fields = array_diff_assoc($newInstall->dump(), $originalInstall->dump());
     $fields['id'] = $originalInstall->getId();
     $query = sprintf(static::UPDATE_PATCH, $this->buildSet($fields));
     $this->query->write($query, $fields);
 }