| @@ 79-85 (lines=7) @@ | ||
| 76 | parent::__construct($this->_table, $config); |
|
| 77 | ||
| 78 | if ($this->config('autoBind')) { |
|
| 79 | if ($this->_table->hasField($this->config('createdByField'))) { |
|
| 80 | $this->_table->belongsTo('CreatedBy', [ |
|
| 81 | 'className' => $this->config('userModel'), |
|
| 82 | 'foreignKey' => $this->config('createdByField'), |
|
| 83 | 'propertyName' => 'created_by', |
|
| 84 | ]); |
|
| 85 | } |
|
| 86 | ||
| 87 | if ($this->_table->hasField($this->config('modifiedByField'))) { |
|
| 88 | $this->_table->belongsTo('ModifiedBy', [ |
|
| @@ 87-93 (lines=7) @@ | ||
| 84 | ]); |
|
| 85 | } |
|
| 86 | ||
| 87 | if ($this->_table->hasField($this->config('modifiedByField'))) { |
|
| 88 | $this->_table->belongsTo('ModifiedBy', [ |
|
| 89 | 'className' => $this->config('userModel'), |
|
| 90 | 'foreignKey' => $this->config('modifiedByField'), |
|
| 91 | 'propertyName' => 'modified_by', |
|
| 92 | ]); |
|
| 93 | } |
|
| 94 | } |
|
| 95 | } |
|
| 96 | ||