protected function doUpdate(RecordInterface $record, Version $version) { $this->testCase->assertEquals(1, $record->getId()); $this->testCase->assertEquals(3, $record->getUserId()); $this->testCase->assertEquals('foobar', $record->getTitle()); return array('success' => true, 'message' => 'You have successful update a record'); }
protected function doUpdate(RecordInterface $record, Version $version) { $this->testCase->assertEquals(1, $record->getId()); $this->testCase->assertEquals(3, $record->getUserId()); $this->testCase->assertEquals('foobar', $record->getTitle()); }
/** * Returns the POST response * * @param \PSX\Data\RecordInterface $record * @param \PSX\Api\Version $version * @return array|\PSX\Data\RecordInterface */ protected function doCreate(RecordInterface $record, Version $version) { $appKey = TokenGenerator::generateAppKey(); $appSecret = TokenGenerator::generateAppSecret(); $table = $this->tableManager->getTable('Fusio\\Impl\\Backend\\Table\\App'); $table->create(array('userId' => $record->getUserId(), 'status' => $record->getStatus(), 'name' => $record->getName(), 'url' => $record->getUrl(), 'appKey' => $appKey, 'appSecret' => $appSecret, 'date' => new DateTime())); $appId = $table->getLastInsertId(); // insert scopes to the app which are assigned to the user $this->insertDefaultScopes($appId, $record->getUserId()); return array('success' => true, 'message' => 'App successful created'); }