/** @noinspection PhpTooManyParametersInspection
  * @inheritdoc
  *
  * @SuppressWarnings(PHPMD.StaticAccess)
  */
 public function canSetBelongToManyOnUpdate(ErrorCollection $errors, Model $model, Schema $schema, $resRelationshipName, $modRelationshipName, $idx = null)
 {
     $relModelClass = $this->getBelongToManyRelationshipModelClass($schema, $resRelationshipName);
     $arguments = [$model, $modRelationshipName, $idx, $relModelClass];
     $allowed = $this->getGate()->allows(BasePolicy::CAN_SET_RELATIONSHIP_ON_UPDATE, $arguments);
     if ($allowed === false) {
         $errors->addRelationshipError($resRelationshipName, T::trans(T::KEY_ERR_UNAUTHORIZED));
     }
     return $allowed;
 }