Пример #1
0
 /**
  * Returns all linked AuditError instances
  * @return AuditError[]
  */
 public function getTrail()
 {
     return static::hasMany(AuditTrail::className(), ['audit_id' => 'id']);
 }
Пример #2
0
 /**
  * ($this)  getAuditTrails : get trails for this model
  * @return  $this
  */
 public function getAuditTrails()
 {
     return $this->hasMany(AuditTrail::className(), ['model_id' => 'mid'])->andOnCondition(['REGEXP', 'field', '^\\[(.)*\\]$'])->andOnCondition(['model' => get_class($this)]);
 }