public static function storeEditableCmsTable($table, array $data): array
    {
        $res = ['add' => 0, 'update' => 0, 'delete' => 0];

        // Field to be updated
        if (isset($data['update']) && \is_array($data['update'])) {
            foreach ($data['update'] as $id => $v) {
                $res['update'] += self::update($table, $v, $id);
            }
        }

        // Delete fields
        if (isset($data['delete']) && \is_array($data['delete'])) {
            foreach ($data['delete'] as $v) {
                $res['delete'] += self::getInstance()->delete($table, $v);
            }
        }

        // Same as deleted
        if (isset($data['remove']) && \is_array($data['remove'])) {
            foreach ($data['remove'] as $v) {
                $res['delete'] += self::getInstance()->delete($table, $v);
            }
        }

        // Create new fields
        if (isset($data['add']) && \is_array($data['add'])) {
            foreach ($data['add'] as $v) {
                $res['add'] += self::add($table, $v);
            }
        }

        return $res;
    }
public static function storeEditableCmsTable($table, array $data): array
    {
        $res = ['add' => 0, 'update' => 0, 'delete' => 0];

        // Field to be updated
        if (isset($data['update']) && \is_array($data['update'])) {
            foreach ($data['update'] as $id => $v) {
                $res['update'] += self::update($table, $v, $id);
            }
        }

        // Delete fields
        if (isset($data['delete']) && \is_array($data['delete'])) {
            foreach ($data['delete'] as $v) {
                $res['delete'] += self::getInstance()->delete($table, $v);
            }
        }

        // Same as deleted
        if (isset($data['remove']) && \is_array($data['remove'])) {
            foreach ($data['remove'] as $v) {
                $res['delete'] += self::getInstance()->delete($table, $v);
            }
        }

        // Create new fields
        if (isset($data['add']) && \is_array($data['add'])) {
            foreach ($data['add'] as $v) {
                $res['add'] += self::add($table, $v);
            }
        }

        return $res;
    }
public static function storeEditableCmsTable ( $ table , array $ data ) : array { $ res = [ 'add' => 0 , 'update' => 0 , 'delete' => 0 ] ; // Field to be updated if ( isset ( $ data [ 'update' ] ) && \ is_array ( $ data [ 'update' ] ) ) { foreach ( $ data [ 'update' ] as $ id => $ v ) { $ res [ 'update' ] += self :: update ( $ table , $ v , $ id ) ; } } // Delete fields if ( isset ( $ data [ 'delete' ] ) && \ is_array ( $ data [ 'delete' ] ) ) { foreach ( $ data [ 'delete' ] as $ v ) { $ res [ 'delete' ] += self :: getInstance ( ) -> delete ( $ table , $ v ) ; } } // Same as deleted if ( isset ( $ data [ 'remove' ] ) && \ is_array ( $ data [ 'remove' ] ) ) { foreach ( $ data [ 'remove' ] as $ v ) { $ res [ 'delete' ] += self :: getInstance ( ) -> delete ( $ table , $ v ) ; } } // Create new fields if ( isset ( $ data [ 'add' ] ) && \ is_array ( $ data [ 'add' ] ) ) { foreach ( $ data [ 'add' ] as $ v ) { $ res [ 'add' ] += self :: add ( $ table , $ v ) ; } } return $ res ; }
This function saves all table data when using table with form inputs

@param string $table
@param array $data
@return array
This function saves all table data when using table with form inputs