migrate_example_oracle.module in Migrate 6.2
Same filename and directory in other branches
File
migrate_example/migrate_example_oracle/migrate_example_oracle.moduleView source
<?php
include_once 'migrate_example_oracle.features.inc';
/**
* Generate a text string of reproducible contents for a given length.
*
* @param int $length
* Number of characters to generate.
*
* $return
* String of the given length.
*/
function migrate_example_oracle_generate($length) {
$base = 'word ';
// Five characters long
$multiplier = $length / 5 + 1;
// 80% chance of going a bit long, thus substr below
$data = str_repeat($base, $multiplier);
$data = substr($data, 0, $length);
return $data;
}
/**
* Return an array of data rows for testing Oracle import. Note that 4000 is a magic
* number for Oracle LOB datatypes, so we testing lengths above and below that limit.
*/
function migrate_example_oracle_sample_data() {
return array(
array(
'oid' => 3,
'title' => 'Sample title',
'body' => 'Sample body',
'created' => '2011/05/01 01:02:03',
'updated' => '2011/06/30 04:05:06',
),
array(
'oid' => 5,
'title' => 'Another title',
'body' => migrate_example_oracle_generate(3900),
'created' => '2011/08/12 07:08:09',
'updated' => '2011/12/25 10:11:12',
),
array(
'oid' => 7,
'title' => 'Yet another title',
'body' => migrate_example_oracle_generate(4500),
'created' => '2012/01/01 13:14:15',
'updated' => '2012/03/14 16:17:18',
),
);
}
Functions
Name![]() |
Description |
---|---|
migrate_example_oracle_generate | Generate a text string of reproducible contents for a given length. |
migrate_example_oracle_sample_data | Return an array of data rows for testing Oracle import. Note that 4000 is a magic number for Oracle LOB datatypes, so we testing lengths above and below that limit. |