Permalink
Browse files

BackwardsCompatibilityBreak - Changed the separator between the table…

… name and column name for related form inputs from :: to . - users::user_id[] will now be users.user_id[]
  • Loading branch information...
wbond committed Oct 2, 2008
1 parent e27ca21 commit 96b8a2f2f14feb68fc879910e56465d5e780d741
Showing with 6 additions and 6 deletions.
  1. +6 −6 classes/fORMRelated.php
View
@@ -206,14 +206,14 @@ static public function determineRequestFilter($class, $related_class, $route)
$filter_table = $related_table;
$filter_table_with_route = $related_table . '{' . $route_name . '}';
$pk_field = $filter_table . '::' . $first_pk_column;
$pk_field_with_route = $filter_table_with_route . '::' . $first_pk_column;
$pk_field = $filter_table . '.' . $first_pk_column;
$pk_field_with_route = $filter_table_with_route . '.' . $first_pk_column;
if (!fRequest::check($pk_field) && fRequest::check($pk_field_with_route)) {
$filter_table = $filter_table_with_route;
}
return $filter_table . '::';
return $filter_table . '.';
}
@@ -290,7 +290,7 @@ static public function linkRecords($class, &$related_records, $related_class, $r
$relationship = fORMSchema::getRoute($table, $related_table, $route, 'many-to-many');
$field_table = $relationship['related_table'];
$field_column = '::' . $relationship['related_column'];
$field_column = '.' . $relationship['related_column'];
$field = $field_table . $field_column;
$field_with_route = $field_table . '{' . $route_name . '}' . $field_column;
@@ -303,7 +303,7 @@ static public function linkRecords($class, &$related_records, $related_class, $r
$record_set = fRecordSet::build(
$related_class,
array(
str_replace('::', '.', $field_with_route) . '=' => fRequest::get($field, 'array', array())
$field_with_route . '=' => fRequest::get($field, 'array', array())
)
);
@@ -707,7 +707,7 @@ static public function storeOneToMany(&$values, $relationship, $record_set)
$set_method_name = 'set' . fGrammar::camelize($relationship['related_column'], TRUE);
$record_number = 0;
$filter = fORMRelated::determineRequestFilter(fORM::classize($relationship['table']), $related_class, $relationship['related_column']);
$filter = self::determineRequestFilter(fORM::classize($relationship['table']), $related_class, $relationship['related_column']);
foreach ($record_set as $record) {
fRequest::filter($filter, $record_number);

0 comments on commit 96b8a2f

Please sign in to comment.