Hi,
Thanks so much for this nice interface to mysql - it's really great.
I'm having trouble getting more than 30 rows back from a getRelatedRecordObjects sql query. My end goal is to import data from a csv but to only insert data if one of the columns in a row is new ('out' below), otherwise, perform an update to the existing row.
from my table delegate class:
function __import__csv(&$data, $defaultValues=array()){
$app =& Dataface_Application::getInstance();
$Rec_existing =& $app->getRecord();
//...snip... from standard import_csv function
foreach ( $rows as $row ){
list($in, $data, $new_out) = explode(',', $row);
$new = 1;
foreach ($Rec_existing->getRelatedRecordObjects('xouts') as $xout){
if($xout->val('out') == $new_out) {
$new = 0;
}
}
}
}
in relationships.ini:
[xouts]
__sql__ = "SELECT * FROM tableX ORDER by out"
The foreach statement only runs through 30 rows, even if the numbers of rows in tableX is >30. I successfully altered the display to display more than 30 rows, but this seems to have no effect on getRelatedRecordObjects. Adding a different LIMIT in the query, just gives an error as it coflicts with the LIMIT 0,30 already automatically added later.
Any clues, or potentially advice on a better way to do this? I am not sure how to leverage sql directly to find the matching values as I only know what to match from inside the import_csv function.
Thanks,
Rich