serializeVariableValue($variable); return [ self::VARIABLES_FK_COLUMN => $deliveryResultIdentifier, self::TEST_COLUMN => $test, self::VARIABLE_IDENTIFIER => $variable->getIdentifier(), self::VARIABLE_VALUE => $serializedVariable, self::VARIABLE_HASH => $deliveryResultIdentifier . md5($deliveryResultIdentifier . $serializedVariable . $callId), ]; } /** * @inheritDoc */ public function createVariablesTable(Schema $schema) { $table = $schema->createtable(self::VARIABLES_TABLENAME); $table->addOption('engine', 'MyISAM'); $table->addColumn(self::VARIABLES_TABLE_ID, 'integer', ['autoincrement' => true]); $table->addColumn(self::CALL_ID_TEST_COLUMN, 'string', ['notnull' => false, 'length' => 255]); $table->addColumn(self::CALL_ID_ITEM_COLUMN, 'string', ['notnull' => false, 'length' => 255]); $table->addColumn(self::TEST_COLUMN, 'string', ['notnull' => false, 'length' => 255]); $table->addColumn(self::ITEM_COLUMN, 'string', ['notnull' => false, 'length' => 255]); $table->addColumn(self::VARIABLE_VALUE, 'text', ['notnull' => false]); $table->addColumn(self::VARIABLE_IDENTIFIER, 'string', ['notnull' => false, 'length' => 255]); $table->addColumn(self::VARIABLES_FK_COLUMN, 'string', ['length' => 255]); $table->addColumn(self::VARIABLE_HASH, 'string', ['length' => 255, 'notnull' => false]); $table->setPrimaryKey([self::VARIABLES_TABLE_ID]); $table->addUniqueIndex([self::VARIABLE_HASH], self::UNIQUE_VARIABLE_INDEX); $table->addIndex([self::CALL_ID_ITEM_COLUMN], self::CALL_ID_ITEM_INDEX); $table->addIndex([self::CALL_ID_TEST_COLUMN], self::CALL_ID_TEST_INDEX); return $table; } }