Last active
April 21, 2019 11:37
-
-
Save Titoratus/9e93e6809a6a82c08c4015fee23ebf2f to your computer and use it in GitHub Desktop.
[OctoberCMS] Значение purged поля ПОСЛЕ создания модели
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyModel extends Model | |
{ | |
... | |
public function afterCreate() | |
{ | |
// вот значение purged поля _extras | |
// подчкёркивание (_) означает, что это поле (которое в форме) не будет сохраняться в данной модели MyModel. | |
// но я хочу получить его для сохранения в другую модель. | |
$val = $this->getOriginalPurgeValue('_extras'); | |
} | |
protected $purgeable = ['_extras']; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment