| @@ 758-765 (lines=8) @@ | ||
| 755 | ||
| 756 | // Create the mold for a single row insert. |
|
| 757 | $insertData = '('; |
|
| 758 | foreach ($columns as $columnName => $type) |
|
| 759 | { |
|
| 760 | // Are we restricting the length? |
|
| 761 | if (strpos($type, 'string-') !== false) |
|
| 762 | $insertData .= sprintf('SUBSTRING({string:%1$s}, 1, ' . substr($type, 7) . '), ', $columnName); |
|
| 763 | else |
|
| 764 | $insertData .= sprintf('{%1$s:%2$s}, ', $type, $columnName); |
|
| 765 | } |
|
| 766 | $insertData = substr($insertData, 0, -2) . ')'; |
|
| 767 | ||
| 768 | // Create an array consisting of only the columns. |
|
| @@ 733-740 (lines=8) @@ | ||
| 730 | { |
|
| 731 | // Create the mold for a single row insert. |
|
| 732 | $insertData = '('; |
|
| 733 | foreach ($columns as $columnName => $type) |
|
| 734 | { |
|
| 735 | // Are we restricting the length? |
|
| 736 | if (strpos($type, 'string-') !== false) |
|
| 737 | $insertData .= sprintf('SUBSTRING({string:%1$s}, 1, ' . substr($type, 7) . '), ', $columnName); |
|
| 738 | else |
|
| 739 | $insertData .= sprintf('{%1$s:%2$s}, ', $type, $columnName); |
|
| 740 | } |
|
| 741 | $insertData = substr($insertData, 0, -2) . ')'; |
|
| 742 | ||
| 743 | // Create an array consisting of only the columns. |
|