Created
January 13, 2016 15:40
-
-
Save marceloandrader/0e0ad6e50c24da2d6b2f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/app/libraries/Core/Entity.php b/app/libraries/Core/Entity.php | |
index 454652b..05d3abb 100644 | |
--- a/app/libraries/Core/Entity.php | |
+++ b/app/libraries/Core/Entity.php | |
@@ -224,13 +224,14 @@ class Entity extends \PhalconRest\API\Entity | |
// this must be attached w/ the parent records for joining purposes | |
$relatedRecordIds = null; | |
$refModel = new $refModelNameSpace(); | |
- $primaryKeyName = $refModel->getPrimaryKeyName(); | |
+ $primaryKeyName = 'child_id'; // $refModel->getPrimaryKeyName(); | |
// save the PKID for each record returned | |
if (count($relatedRecords) > 0) { | |
$relatedRecordIds = array(); | |
- foreach ($relatedRecords as $rec) { | |
+ foreach ($relatedRecords as &$rec) { | |
$relatedRecordIds[] = $rec[$primaryKeyName]; | |
+ $rec['id'] = $rec[$primaryKeyName]; | |
} | |
} else { | |
$relatedRecordIds = null; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment