При сохранении записи в accounts я использую следующий код
Код: Выделить всё
parent::afterSave();
if ($this->isNewRecord) {
$this->profiles = new Profile;
$this->profiles->account_id = $this->id;
if ($this->profiles->save(false)) {
return true;
}
}
Код: Выделить всё
public function afterSave() {
parent::afterSave();
if ($this->isNewRecord) {
$this->details = new Details;
$this->details->profile_id = $this->account_id;
if (!$this->details->save()) {
echo '<pre>';
print_r($this->details->erorrs);
exit;
}
}
}
Код: Выделить всё
public function afterSave() {
parent::afterSave();
exit('dsadsadsa');
}
Код: Выделить всё
public function afterSave() {
exit('dsadsadsa');
}