Skip to content

Commit

Permalink
Performance enhancement for stitching related data to parent record
Browse files Browse the repository at this point in the history
  • Loading branch information
rotimi committed Feb 27, 2023
1 parent 30879d1 commit 2b64eeb
Showing 1 changed file with 0 additions and 45 deletions.
45 changes: 0 additions & 45 deletions src/LeanOrm/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -919,51 +919,6 @@ protected function loadHasOne(
////////////////////////////////////////////////////////////////
// End: Stitch the related data to the approriate parent records
////////////////////////////////////////////////////////////////




















// //stitch the related data to the approriate parent records
// foreach( $parent_data as $p_rec_key => $parent_record ) {
//
// if( isset($related_data[$parent_record[$fkey_col_in_my_table]]) ) {
// $matching_related_record =
// [$related_data[$parent_record[$fkey_col_in_my_table]]];
//
// $this->wrapRelatedDataInsideRecordsAndCollection(
// $matching_related_record, $foreign_model_obj,
// $wrap_row_in_a_record, false
// );
//
// //set the related data for the current parent record
// if( $parent_record instanceof \GDAO\Model\RecordInterface ) {
//
// $parent_data[$p_rec_key]
// ->setRelatedData($rel_name, $matching_related_record[0]);
//
// } else {
//
// //the current record must be an array
// $parent_data[$p_rec_key][$rel_name] = $matching_related_record[0];
// }
// }
// } //foreach( $parent_data as $p_rec_key => $parent_record )

} else if ( $parent_data instanceof \GDAO\Model\RecordInterface ) {

Expand Down

0 comments on commit 2b64eeb

Please sign in to comment.