APIv4 - Refactor writeObjects to choose BAO function based on annotations
[civicrm-core.git] / Civi / Api4 / Action / GroupContact / GroupContactSaveTrait.php
index 0060ba0487fcc0828809a754ebacb18d00ced3b8..4ceea29b40354671454152265502555473d6e964 100644 (file)
@@ -39,12 +39,12 @@ trait GroupContactSaveTrait {
   /**
    * @inheritDoc
    */
-  protected function writeObjects(&$items) {
+  protected function write(array $items) {
     foreach ($items as &$item) {
       $item['method'] = $this->method;
       $item['tracking'] = $this->tracking;
     }
-    return parent::writeObjects($items);
+    return \CRM_Contact_BAO_GroupContact::writeRecords($items);
   }
 
 }