Skip to content

Instantly share code, notes, and snippets.

@n00ge
Last active December 25, 2015 14:59
Show Gist options
  • Save n00ge/6995256 to your computer and use it in GitHub Desktop.
Save n00ge/6995256 to your computer and use it in GitHub Desktop.
public function push()
{
foreach ($this->builtParentAssociations as $association => $model) {
if (! $model->save) {
return false;
}
// get foreign key for association off $this association and assign $model->getKey()
}
if (! parent::push()) {
return false;
}
foreach ($this->builtChildAssociations as $association => $model) {
// get foreign key for association off $model association and assign $this->id
if (! $model->save) {
return false;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment