Last active
July 19, 2018 13:37
-
-
Save kyleheddon/a03c8ab1536b899379b0a7b410a646c0 to your computer and use it in GitHub Desktop.
DataView.php
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
<?php | |
$accessRequest = new RecordAccessRequest($prospect, ['id', 'name', 'email', 'secret']); | |
$accessRequest.addRelatedRecord($account, ['id', 'name', 'address', 'super_secret']); | |
$accessRequest.addRelatedRecord($secretRecord, ['id', 'name']); | |
$accessRequest.addRelatedRequest('', ['id', 'name', 'type']); | |
$accessRequest.addRelatedCollectionRequest('visitor_activity', ['id', 'name', 'type']); | |
$fields = RecordAccessManager::getFields($accessRequest, $user); | |
print_r($fields); | |
/** | |
[ | |
'prospect' => [ | |
'id' => 7, | |
'name' => 'Kyle', | |
'email' => '[email protected]', | |
'account_id' => 3 | |
], | |
'visitor_activity' => [ | |
['id' => 1, 'type' => 'Page View', 'created_at' => '12-12-2007'], | |
['id' => 2, 'type' => 'Email Open', 'created_at' => '4-14-2012'] | |
], | |
'account' => [ | |
'id' => 3, | |
'name' => 'Honda', | |
'address' => '123 Main St.', | |
'super_secret' => 'Don/'t tell..', | |
'record_home_url' => '/account/do/read/3' | |
] | |
] | |
*/ | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment