| @@ 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. |
|
| @@ 788-795 (lines=8) @@ | ||
| 785 | { |
|
| 786 | // Create the mold for a single row insert. |
|
| 787 | $insertData = '('; |
|
| 788 | foreach ($columns as $columnName => $type) |
|
| 789 | { |
|
| 790 | // Are we restricting the length? |
|
| 791 | if (strpos($type, 'string-') !== false) |
|
| 792 | $insertData .= sprintf('SUBSTRING({string:%1$s}, 1, ' . substr($type, 7) . '), ', $columnName); |
|
| 793 | else |
|
| 794 | $insertData .= sprintf('{%1$s:%2$s}, ', $type, $columnName); |
|
| 795 | } |
|
| 796 | $insertData = substr($insertData, 0, -2) . ')'; |
|
| 797 | ||
| 798 | // Create an array consisting of only the columns. |
|