public static function createGlobalPermissions($globalPermissions, $id)
    {
        $query = [];

        if ($globalPermissions) {
            // Create global permissions
            foreach ($globalPermissions as $globalPermissionKey => $globalPermissionValue){
                if($globalPermissionValue) {
                    $query[] = array(
                        'groupID' => $id,
                        'app' => 'global',
                        'key' => $globalPermissionKey,
                        'value' => true,
                        'ids' => null,
                        'hasAll' => false,
                    );
                }
            }
        }
        return $query;
    }
public static function createGlobalPermissions($globalPermissions, $id)
    {
        $query = [];

        if ($globalPermissions) {
            // Create global permissions
            foreach ($globalPermissions as $globalPermissionKey => $globalPermissionValue){
                if($globalPermissionValue) {
                    $query[] = array(
                        'groupID' => $id,
                        'app' => 'global',
                        'key' => $globalPermissionKey,
                        'value' => true,
                        'ids' => null,
                        'hasAll' => false,
                    );
                }
            }
        }
        return $query;
    }
public static function createGlobalPermissions ( $ globalPermissions , $ id ) { $ query = [ ] ; if ( $ globalPermissions ) { // Create global permissions foreach ( $ globalPermissions as $ globalPermissionKey => $ globalPermissionValue ) { if ( $ globalPermissionValue ) { $ query [ ] = array ( 'groupID' => $ id , 'app' => 'global' , 'key' => $ globalPermissionKey , 'value' => true , 'ids' => null , 'hasAll' => false , ) ; } } } return $ query ; }
Prepare global permission array to be stored on database.
Gets input from the front-end and customizes object to be stored as JSON in DB.

@param  $globalPermissions
@param  $id
@return array
Prepare global permission array to be stored on database . Gets input from the front - end and customizes object to be stored as JSON in DB .