public function update($schemaId, $name, $source) { $schema = $this->schemaTable->get($schemaId); if (!empty($schema)) { $this->schemaTable->update(array('id' => $schema['id'], 'name' => $name, 'source' => $source, 'cache' => $this->schemaParser->parse(json_encode($source)))); } else { throw new StatusCode\NotFoundException('Could not find schema'); } }