protected function insert(Feeding $feeding)
 {
     DebugLog::log('1');
     $feeding->setId($this->uuidHelper->get());
     DebugLog::log('2');
     DebugLog::log('3');
     $this->dbFactory->getConnection()->update("insert into feedings set\n\t\t\t\t  `id`=:id\n\t\t\t\t, `date_time`=:date_time\n\t\t\t\t, `status`=:status\n\t\t\t\t, `breast_left`=:breast_left\n\t\t\t\t, `breast_right`=:breast_right\n\t\t\t\t, `milking`=:milking\n\t\t\t\t, `pee`=:pee\n\t\t\t\t, `poo`=:poo\n\t\t\t\t, `bottle`=:bottle\n\t\t\t", array('id' => $feeding->getId(), 'date_time' => $feeding->getDateTime()->format('Y-m-d H:i:s'), 'status' => $feeding->getStatus(), 'breast_left' => $feeding->getBreastLeft(), 'breast_right' => $feeding->getBreastRight(), 'milking' => $feeding->getMilking(), 'pee' => $feeding->getPee(), 'poo' => $feeding->getPoo(), 'bottle' => $feeding->hasBottle() ? $feeding->getBottle()->encode() : null));
     DebugLog::log('4');
 }
Esempio n. 2
0
 public function testExistingUuuid()
 {
     $testUuid = UuidHelper::generateUUID();
     $newUser = new UserWithUuid();
     $newUser->username = '******';
     $newUser->id = '/functional/test';
     $newUser->uuid = $testUuid;
     $this->dm->persist($newUser);
     $uuidPostPersist = $newUser->uuid;
     $this->assertNotNull($uuidPostPersist);
     $this->assertEquals($testUuid, $uuidPostPersist);
     $this->dm->flush();
     $this->dm->clear();
     $flushedUser = $this->dm->find(null, '/functional/test');
     $this->assertEquals($testUuid, $flushedUser->uuid);
 }