Skip to content

Instantly share code, notes, and snippets.

@adrexia
Created June 18, 2014 04:32
Show Gist options
  • Save adrexia/12c309a197a79e54718d to your computer and use it in GitHub Desktop.
Save adrexia/12c309a197a79e54718d to your computer and use it in GitHub Desktop.
Silverstripe - Manually add Many Many Relations
public function setManyManyRelation($relationFieldList){
if(!$relationFieldList){
return false;
}
foreach($relationFieldList as $relation){
$this->ManyManyRelation()->add($relation);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment