-
data inflating will only happen when using accessor method.
$book->is_published; // will return the raw value from database. $book->isPublished() // will return Boolean value (true or false)
-
boolean columns will generate
isXXX
accessors."published" => "isPublished()" "is_published" => "isPublished()"
-
BaseModel::load
now returns record object instead of returning a Result object:$foundBook = Book::load(321);
-
Replace
create
withcreateAndLoad
:$author = new Author; $author = $author->createAndLoad(array( 'name' => 'Z' , 'email' => 'z@z' , 'identity' => 'z' ));
-
Fix
create
andfind
logics:
- BaseModel::create now returns Result object directly and don't reload created data to the object itself.
- BaseModel::load now returns the found record instead of load the data to the object itself.
-
BaseModel::deflate
method is removed. -
BaseModel::deflateData
method is removed. -
BaseModel::getSchema
method is now static. -
Remove arguments from beforeDelete and afterDelete (the user may get the data from the data object directly)
-
createOrUpdate
is now renamed toupdateOrCreate
. -
BaseModel::load
is now static method. -
Trigger methods like
beforeCreate
,beforeUpdate
,afterUpdate
are moved to BaseRepo. -
lockWrite
=>BaseRepo::writeLock
,lockRead
=>BaseRepo::readLock
-
Renamed
BaseRepo::load
toBaseRepo::loadWith
. -
load
is now a generic method for both primary key and conditions in array. -
Added
BaseRepo::loadByKeys
for load with keys. -
BaseModel::loadByPrimaryKey
andBaseRepo::loadByPrimaryKey
are added. -
BaseModel::find
is removed.
setData()
,getData()
were renamed tosetStashedData()
,getStashedData()
column::notNull
changed tonotNull()
- Renamed
Relationship::order()
toRelationship::orderBy()
- Rebuild
SQLBuilder\Universal\SelectQuery
from Relationship with thefilter
andwhere
. - Add a test case for relationship with custom where conditions, filter and order by and group by.