After 20 days of improvement and testing, the secondBetatest version of ThinkPHP5.2 has been released. This time, the processing mechanism of thefetchSqlmethod is mainly improved, and many query usages are unified and simplified.
Major Update
##Improved the parsing mechanism of fetchSql
Introduced a separateFetchThe class handles thefetchSqlmethod separately to ensure that the return type of theQueryclass query method is not affected byfetchSql.
Unify and simplify query usage
This test version unifies and streamlines many query usages, so that you will not have another query It solves the problem of multiple usages of functions and facilitates the formulation of team norms.get/allThe query method is unified into thefind/selectmethod;
fetchPdomethod and return thePDOobject uniformly using thepdoquery method;
resultset_typeConfiguration uniformly uses thefetchCollectionmethod;
readMastermethod and uniformly uses themastermethod;
savemethod does not support incoming conditions, unified query and update method calls;
db/modelAssistant function, unified use of class calls;
AddedfetchArrayMethod
If model query is used, you can now call thefetchArraymethod, and the query result will be Array data is always returned. Facilitates the data transfer of some statistical charts.
Use the DateTime class for time field writing instead
Use theDateTimeclass for automatic operation of time fields, supporting micro Second-level time records provide higher-precision system time records.
You only need to set the decimal precision of the time field in the data table to automatically record. If you need to output microsecond precision data, set thedateTimeFormatformat.
The model adds schema attribute
The model addsschemaattribute support, which is used to define the fields and types of the corresponding data table information, and supports the use of PHP variable type definitions. After defining this attribute, you can improve query performance and automatically identify the parameter binding type of the field without usingoptimize:schema.
The type attribute of the model is only used to set data table fields for automatic type conversion.Support application of public function files
In multi-application mode, support loading of application public function files.Automatic recognition of multiple entry files
#If the application name is not specified in the application entry file, the current entry file can be automatically identified when the entry file is accessed Application Name. By default, the file name of the current application entry will be used as the application name.Some methods are no longer supported
The following usages are no longer supported due to practicality or simplification considerations: ## The#Queryclass (can be replaced by the pdo method); the
classget/all/getOrFail/allOrFailmethod;
whereparameter; thereadMastermethod of the
Queryclass and model class , this method cannot be used normally underswoole(manually call themastermethod if necessary);setInc# of the
methods;database’s
resultset_type(call if necessary
fetchCollectiondb
class static method instead);
##Improve
joinAbandonedsave
methodCancel thesetInc
andof the model class
Improve the acquisition of model field information
Cancel the model and thereadMastermethod of theDbclass
Improve parameter binding type retrieval
Queryclass addedfetchArraymethod supports model query return array type
Automatic writing of time fields is changed to use theDateTimeclass, which supports microsecond data
Improved validation class extended validation Do not check whetherrequire
Improve queryCURDmethod
Correction model output
ImprovementupdateMethod
CorrectioninsertGetIdMethod
CorrectiongetFieldTypeMethod
ImprovementthinkschemaDirective
Improve cache and log path acquisition
DeletedbAssistant function Correct several assistant functions
BuilderClassselectMethod adds a second parameter
Cancelresultset_typeSet
Correction of dynamic query methodfetchsqlProcessing
Improve automatic identification of multi-application entry files
serverReturn type of method
getBindMethod
Configuration parameters
##Correction of resource routingCorrection
Improvement Controller
Correction
##Correction
requestCorrection
consoleCancel the
getclass ##allMethods are uniformly usedfind/selectMethodCancelfetchPdo
MethodFix thelimit
parameter of##Improve errors in strict mode
Method added
Fetch