Search
Create a comparison
Compare Sizes
Register
Sign in
Sign out
English
Français
Español
History of
Yii ORM
Last update
2017-12-21 16:45:09
Creation date
2016-10-18 22:11:55
Romans Malinovskis
on 2017-12-21 16:45:09
Report
Transparent support for NoSQL
yes Avialable cross sql and nosql datababase relations (https://github.com/yiisoft/yii2-mongodb)
Romans Malinovskis
on 2017-12-19 21:41:37
Report
Read-only Models
Model without primary key
Romans Malinovskis
on 2017-12-19 21:22:55
Report
full support for OR conditions
-
Romans Malinovskis
on 2016-10-24 17:09:26
Report
Support model-level criteria
no
Romans Malinovskis
on 2016-10-24 02:14:50
Report
Deep Many-to-Many traversal.
- only with "to-one" references: $book->author->address->street; Executes multiple queries.
UI extensions
no
Romans Malinovskis
on 2016-10-24 02:00:53
Report
User-defined query template
yes (please link doc)
Model without primary key
- User::find()->where(...)->andWhere(...)->one()
Admin extends User, adds accessible fields
no
Romans Malinovskis
on 2016-10-21 18:57:20
Report
How to invoke db-vendor-specific extensions?
yes SQL - Query Builder.
Map Entity to SubQuery
- table = new Expression(..)
Map property to expression
- (couldn't find docs)
Map field to sub-query on related entity (Client.balance = Client->orders->sum(total))
- (couldn't find docs)
Entity to join multiple tables (adding new record populates both tables)
no No native support.
Domain Model Criteria
no Only for specific query: User::find()->byEmail('...')->active()->one()
Expression-based condition
no Only for query: User::find()->andWhere('...')->all()
Criteria Compliance (new record must match condition)
no
Dynamic criteria
no Only Querying: User::find()->where(['a' => '1', 'b' => true])->all();
Reference domain-model field in query
no Field is class property.
Use Domain logic in multi-record update
no
Admin extends User, adds criteria (is_admin=1)
no Can be done as wrapper: User::findAdmin(..) or custom CDbCriteria
Extend model, add Join (Disjoined SubTypes)
no
One-to-many traversal strategy
Uses classical eager/lazy loading approach. with() can help pre-fetch the data for related entities.
Many-to-Many
yes relations() method of an entity can define.
Cross-Persistence traversal
- No docs.
Persistence-specific hooks (to modify Query)
- (no docs)
Implementation Strategy
Widgets must specify data types manually, while dataProvider is used for fetching the data stream.
field storing reference to another Model can map into DropDown
no
UI Widget can get Field type, default value, caption, hint
- (no docs)
Same model, multiple persistences
- (no docs)
Deep Many-to-Many traversal.
- $book->author->address->street;
UI Widget can fetch list of Model Fields
- \yii\grid\GridView, \yii\widgets\ListView
Роман Журавлев
on 2016-10-21 16:22:28
Report
UI Widget can get Field type, default value, caption, hint
yes \yii\grid\GridView, \yii\widgets\ListView, \yii\widgets\DetailView
Роман Журавлев
on 2016-10-21 16:20:35
Report
User-defined query template
yes
Роман Журавлев
on 2016-10-21 16:07:40
Report
Webseite
http://www.yiiframework.com/
Github / Bitbucket / Sourceforge
https://github.com/yiisoft/yii2
License
BSD-3
Latest version
2.0.10
How schema is defined?
Active record magic properties.
Code generation
yes Web and console generator https://github.com/yiisoft/yii2-gii
Can be used in Any Framework
- Planned in 2.1.x
Automated Cache
yes
Minimum PHP Version
5.4
PDO Support
yes
Transparent support for NoSQL
yes Avialable cross sql and nosql datababase relations
Table Name Mapping
yes Using static method of active record. http://www.yiiframework.com/doc-2.0/guide-db-active-record.html#declaring-ar-classes
Field Name Mapping
yes
Array as a persistence
yes https://github.com/yii2tech/filedb
Map native types (DateTime)
yes Active record behaviors
User-defined types (e.g. "23 USD")
yes Active record behaviors
Map field of related Entity ('currency' = currency_id->Model Currency.name)
yes $model->currency->name
Map field to sub-query on related entity (Client.balance = Client->orders->sum(total))
yes
Entity to join multiple tables (adding new record populates both tables)
- Using events and behaviors
MongoDB support
yes https://github.com/yiisoft/yii2-mongodb
Neo4j
no
Soft-delete
yes Events and behaviors
Domain Model Criteria
yes User::find()->byEmail('...')->active()->one()
Expression-based condition
yes User::find()->andWhere('...')->all()
Dynamic criteria
yes User::find()->where(['a' => '1', 'b' => true])->all();
RestAPI as a persistence
- To extend BaseActiveRecord
JSON string as a persistence
- To extend BaseActiveRecord
Same model, multiple persistences
yes
Convert Model into Query Object
yes \yii\db\ActiveRecord::find()
Raw expression
yes new \yii\db\Expression('...')
Nested/Composite Queries/Expressions
yes Expression can be in any part of query
Reference domain-model field in query
field, where, order, limit
yes \yii\db\ActiveQuery
UPDATE, DELETE, INSERT query building
yes
ALTER, CREATE query building
yes
full support for OR conditions
yes
REPLACE, TRUNCATE
- Throught raw sql in \yii\db\Command
SHOW, DESCRIBE, CALL
- Throught raw sql in \yii\db\Command
Get All Data (2x array)
yes \yii\db\Query::all()
Single row
yes \yii\db\Query::one()
Single Value
yes \yii\db\Query::scalar()
Single Column
yes \yii\db\Query::column()
Iterator
yes
Load by ID
yes User::findOne(1)
Load by other field
yes User::findOne(['id' => 1])
Read-only Models
yes User::findOne('...')
Model without primary key
yes User::find()->where(...)->andWhere(...)->one()
Specify fields to load
yes User::find()->select([])->one()
Admin extends User, adds criteria (is_admin=1)
yes Using scope. User::find()->isAdmin()->all();
Model can define relation to other Model
yes Relations
One-to-Many
yes
Lazy/Eager-loading
yes
One-to-One
yes
Many-to-Many
yes
Deep Many-to-Many traversal.
yes $book->author->address->street;
Cross-Persistence traversal
yes
Before/After operation
yes
Override standard C,R,U,D operations
yes
Persistence-specific hooks (to modify Query)
yes
User-defined hooks
yes
Global Auditing
Override, Add fields to audit log
Reactive actions
Store old/new field values
yes
Date of creation, modification
yes \yii\behaviors\TimestampBehavior
User/IP creation, modification
yes \yii\behaviors\BlameableBehavior
Store incremental revisions
Custom events
yes
Custom fields, table
yes
UI extensions
UI Widget can fetch list of Model Fields
yes \yii\grid\GridView, \yii\widgets\ListView
UI Widget can get Field type, default value, caption, hint
yes
Romans Malinovskis
on 2016-10-20 02:03:21
Report
UI extensions
no
Global Auditing
yes http://www.yiiframework.com/extension/yii2-audittrail/
Override, Add fields to audit log
Adds LoggableBehaviour, that records field values and stores into AuditTrail model.
Reactive actions
Setup "behaiour" for models individually.
Store old/new field values
yes Each field is logged separately with old/new value.
Date of creation, modification
- Not included, but can be done through behaviour.
User/IP creation, modification
no
Store incremental revisions
no
Revert action (undo) and replay (redo)
no
Custom fields, table
- Table name can be defined in params. Field names can't be changed.
Store log in any persistence
no
Access to record-specific history
- Through a custom query.
Romans Malinovskis
on 2016-10-20 00:45:57
Report
Specify fields to load
yes $criteria->select = 't.first_name, t.email';
Save only sends dirty fields
yes
Map property to expression
yes
Map field to sub-query on related entity (Client.balance = Client->orders->sum(total))
no
Reference domain-model field in query
no
Romans Malinovskis
on 2016-10-19 01:41:13
Report
Editor
public
Viewer
public
Romans Malinovskis
on 2016-10-18 22:11:55
Report
Mode
70
Name
Yii ORM
Viewer
unlisted
Editor
romans-malinovskis-1mz2ky79
Category
products
Go back to:
Yii ORM