Home  >  Article  >  Backend Development  >  A framework for universal CRUD functionality in a fast backend within the IcePHP framework

A framework for universal CRUD functionality in a fast backend within the IcePHP framework

黄舟
黄舟Original
2016-12-27 09:48:501405browse

This CRUD is not the CURD in TP. In TP, only the automatic data operations are completed.

I want to complete the configuration through PHP, automatically complete the entire management background, and increase the management of all tables/ Modify/delete/search/multi-select and other operations.

Similar to the scaffolding in Symfony, but I do not generate page code.

But dynamically create output during operation.


The following is a preliminary idea and is being tried


0

Controller’s action

Action

Complete the entire CRUD configuration

and call the processing method of the main CRUD object

1

Main CRUD Class

Scrud

As a container for all CRUD partition objects

As a bridge for message passing of all CRUD partition objects

Record all configurations (assigned to specific partition object records)

Complete the main control process (main specific partition object processing)

2

Table structure configuration class

SCrudConfig

Masters the information of all fields in the entire table

Processes all static judgments about table fields

3

Search bar class

SCrudSearch

As a container for all search criteria objects

Complete the display of search related subjects

Complete search processing

3.1

Exact match search condition class

SCrudSearchEqual

Generate exact match search condition Performance content

Create exact matching query conditions

based on user request parameters

3.2

Fuzzy matching search condition class

SCrudSearchLike

Generate performance content

Create query condition

3.3

Date search condition class

SCrudSearchDate

Generate performance content

Create query conditions

3.4

Radio search condition type

SCrudSearchRadio

Generate performance content

Create query condition

3.5

Check search condition class

SCrudSearchCheck

Generate performance Content

Create query conditions

3.6

Range search conditions Class

SCrudSearchRange

Generate performance content

Create query conditions

3.7

Date range search condition class

SCrudSearchDateRange

Generate performance content

Create query conditions

3.8

Drop-down list search condition class

SCrudSearchList

Generate performance content

Create query conditions

3.9

Drop-down tree search condition class

SCrudSearchTree

Generate performance content

Create query Conditions

4

New configuration class

SCrudInsert

As a container for all editable/non-editable field objects

Generate the performance content of the new record

Complete the processing of the new record

5

Modify configuration class

SCrudUpdate

As a container for all editable/non-editable field objects

Generate the performance content of the edit record

Complete the processing of the edit record

6

View configuration class

SCrudView

As Containers of all non-editable field objects

Generate the performance content of the view details

Complete the processing of the view details (that is, return the list)

7

Delete the configuration class

SCrudDelete

Complete the processing of the delete operation ( True deletion or pseudo deletion)

8

Table configuration class

SCrudGrid

As a container for all list display fields

Generate table display content

8.1

Text field class

SCrudGridText

Generate text field display

Additional function display for generating text fields

8.2

Date field class

SCrudGridDate

Generate field display and display of additional functions

8.3

Time field class

SCrudGridTime

Generate field display and display of additional functions

8.4

Image field class

SCrudGridImage

Generate field display and display of additional functions

9

Operation class

SCrudOPeration

Record the configuration information of all operations

As a container for all specific operation objects

Display the performance of all operations, Displayed by specific operation objects

9.1

Home page operation category

SCrudOperationIndex

Complete the processing of homepage operations

Call relevant objects to complete the display of homepage

9.2

Search operation class

SCrudOperationSearch

Complete search operation processing

Calling each related object to complete the search display (Ajax)

9.3

New operation class

SCrudOperationInsert

Display the new operation

Complete the processing of the new operation

Notify that the new operation is completed

9.4

Modify operation class

SCrudOperationUpdate

Display the modification operation

Complete the processing of the modification operation

Display the modification operation (completed by modifying the configuration class)

9.5

Delete operation class

SCrudOperationDelete

Show delete Operation

completes the processing of the delete operation (completed by the delete configuration class)

9.6

Multi-select delete operation class

SCrudOperationDeleteMulti

Display multi-select delete operation

Complete the processing of multi-select delete operation (by Deletion of configuration class completed)

9.7

View operation class

SCrudOperationView

Display the view operation

Complete the processing of the view operation (completed by the view configuration class)

9.8

Common row-level operations

SCrudOperationRow

Display a common row Level operation

Complete row-level operation on a certain record

9.9

Common table-level operation

SCrudOperationTable

Display a common table-level operation

Process this operation

9.10

Universal multi-selection operation

SCrudOperationMulti

Display a generic multi-select operation

Handle this operation

10

Paging and sorting class

SCrudPage

Display paging, paging size, sorting basis, sorting direction


11

Data Model Class

SCrudModel

Represents the entire Crud system to complete the operation of the database


The above is the general CRUD function framework in the fast backend in the IcePHP framework Content, for more related content, please pay attention to the PHP Chinese website (www.php.cn)!


*&*
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn