0
0
mirror of https://github.com/salesagility/SuiteCRM.git synced 2024-12-28 14:58:08 +00:00
salesagility_SuiteCRM/Api/V8/Helper/VarDefHelper.php
2023-07-18 15:53:08 +01:00

22 lines
553 B
PHP

<?php
namespace Api\V8\Helper;
#[\AllowDynamicProperties]
class VarDefHelper
{
/**
* @param \SugarBean $bean
*
* @return array
*/
public function getAllRelationships(\SugarBean $bean)
{
$relations = [];
$linkedFields = $bean->get_linked_fields();
foreach ($linkedFields as $relation => $varDef) {
if (isset($varDef['module']) && $bean->load_relationship($relation)) {
$relations[$relation] = $varDef['module'];
}
}
return $relations;
}
}