public static function getTableBelongsToFields(Table $table): array
    {
        $fields = [];
        $belongsToModels = Configure::read('RolesCapabilities.accessCheck.belongsToModels');

        foreach ($table->associations() as $association) {
            // skip non-assignation models
            if (!in_array($association->className(), $belongsToModels)) {
                continue;
            }

            $fields[] = $association->foreignKey();
        }

        return $fields;
    }
public static function getTableBelongsToFields(Table $table): array
    {
        $fields = [];
        $belongsToModels = Configure::read('RolesCapabilities.accessCheck.belongsToModels');

        foreach ($table->associations() as $association) {
            // skip non-assignation models
            if (!in_array($association->className(), $belongsToModels)) {
                continue;
            }

            $fields[] = $association->foreignKey();
        }

        return $fields;
    }
public static function getTableBelongsToFields ( Table $ table ) : array { $ fields = [ ] ; $ belongsToModels = Configure :: read ( 'RolesCapabilities.accessCheck.belongsToModels' ) ; foreach ( $ table -> associations ( ) as $ association ) { // skip non-assignation models if ( ! in_array ( $ association -> className ( ) , $ belongsToModels ) ) { continue ; } $ fields [ ] = $ association -> foreignKey ( ) ; } return $ fields ; }
Method that retrieves and returns Table's belongs to fields.

These are fields that dictate assigment, usually foreign key
associated with Groups tables. (example: belongs_to)

@param  \Cake\ORM\Table $table Table instance
@return mixed[]
Method that retrieves and returns Table s belongs to fields .