A new part aggregate root is created and added to the repository.
540517
protected function handleManufacturePartCommand(ManufacturePartCommand $command)
    {
        $part = Part::manufacture($command->partId, $command->manufacturerId, $command->manufacturerName);

        $this->repository->save($part);
    }
121124
public void merge(final ResourceRoot additionalResourceRoot) {
        if(!additionalResourceRoot.getRoot().equals(root)) {
            throw ServerLogger.ROOT_LOGGER.cannotMergeResourceRoot(root, additionalResourceRoot.getRoot());
        }
        usePhysicalCodeSource = additionalResourceRoot.usePhysicalCodeSource;
        if(additionalResourceRoot.getExportFilters().isEmpty()) {
            //new root has no filters, so we don't want our existing filters to break anything
            //see WFLY-1527
            this.exportFilters.clear();
        } else {
            this.exportFilters.addAll(additionalResourceRoot.getExportFilters());
        }
    }
438126
protected function addAssetRepositoryToRootComposer()
    {
        $composer = json_decode(file_get_contents(base_path('composer.json')), true);

        $composer['repositories'][] = [
            'type' => 'path',
            'url' => './'.$this->relativeAssetPath(),
        ];

        file_put_contents(
            base_path('composer.json'),
            json_encode($composer, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)
        );
    }
1238277
@Override
	public void setup(AbstractInvokable parent) {
		agg = ((IterationRuntimeContext) getUdfRuntimeContext()).getIterationAggregator(BulkIterationBase.TERMINATION_CRITERION_AGGREGATOR_NAME);
	}
1115654
public void addRepository(UpdateRepository newRepo) {
        for (UpdateRepository ur : repositories) {
            if (ur.getId().equals(newRepo.getId())) {
                throw new RuntimeException("Repository with id " + newRepo.getId() + " already exists");
            }
        }
        newRepo.refresh();
        repositories.add(newRepo);
    }
491882
private CacheTopology addPartitioner(CacheTopology cacheTopology) {
      ConsistentHash currentCH = cacheTopology.getCurrentCH();
      currentCH = new PartitionerConsistentHash(currentCH, keyPartitioner);
      ConsistentHash pendingCH = cacheTopology.getPendingCH();
      if (pendingCH != null) {
         pendingCH = new PartitionerConsistentHash(pendingCH, keyPartitioner);
      }
      ConsistentHash unionCH = cacheTopology.getUnionCH();
      if (unionCH != null) {
         unionCH = new PartitionerConsistentHash(unionCH, keyPartitioner);
      }
      return new CacheTopology(cacheTopology.getTopologyId(), cacheTopology.getRebalanceId(), currentCH, pendingCH,
            unionCH, cacheTopology.getPhase(), cacheTopology.getActualMembers(), cacheTopology.getMembersPersistentUUIDs());
   }
505748
public void newRepositorySystem() {
        DefaultServiceLocator locator = new DefaultServiceLocator();
        locator.setServices(WagonProvider.class, new ManualWagonProvider());
        locator.addService(RepositoryConnectorFactory.class, WagonRepositoryConnectorFactory.class);

        repositorySystem = locator.getService(RepositorySystem.class);

        MavenRepositorySystemSession session = new MavenRepositorySystemSession();
        session = (MavenRepositorySystemSession)session.setDependencySelector( new AndDependencySelector( session.getDependencySelector(), new ValidSystemScopeDependencySelector() ) );
        session = (MavenRepositorySystemSession)session.setTransferListener(new LogTransferListener());
        session = (MavenRepositorySystemSession)session.setRepositoryListener(new LogRepositoryListener());

        session = (MavenRepositorySystemSession)session.setIgnoreMissingArtifactDescriptor( false );

        LocalRepository localRepo = new LocalRepository( localRepoPath );
        session.setLocalRepositoryManager(repositorySystem.newLocalRepositoryManager(localRepo));

        systemSession = session;
    }
68384
def _add(a, b, relicAdd):
    
    # Check types, create a result object of the same type, and call the relic
    # function.
    assertSameType(a,b)
    result = type(a)()
    relicAdd(byref(result), byref(a), byref(b))
    return result
813758
def Repository(self, *dirs):
        """"""
        for d in dirs:
            if not isinstance(d, SCons.Node.Node):
                d = self.Dir(d)
            self.Top.addRepository(d)
700952
@Process(actionType = AddInMemoryRepository.class)
    public void addInMemoryRepository(final AddInMemoryRepository action, final Channel channel) {
        operationDelegate.onCreateResource(IN_MEMORY_REPOSITORY_ADDRESS,
                action.getProperty().getName(), action.getProperty().getValue(),
                new ChannelCallback(statementContext, channel));
    }
157266
private void createRepositoryDirectoryStructure(File rootDir) {
		this.objs = new File(rootDir, OBJECT_DIR);
		if (!objs.exists()) {
			if (!objs.mkdirs()) {
				throw new RuntimeException("Could not create dir: " + objs.getAbsolutePath());
			}
		}

		this.refs = new File(rootDir, REFERENCE_DIR);
		if (!refs.exists()) {
			if (!refs.mkdirs()) {
				throw new RuntimeException("Could not create dir: " + refs.getAbsolutePath());
			}
		}
	}
603208
protected function insert()
    {
        foreach ($this->scheduledForInsertion as $objectHashId => $entity) {
            // If this entity was a child of aggregate roots, then call its methods to set the aggregate root Id
            $this->entityRegistry->runAggregateRootCallbacks($entity);
            $className  = $this->entityRegistry->getClassName($entity);
            $dataMapper = $this->getDataMapper($className);

            $dataMapper->insert($entity);

            $this->entityRegistry->registerEntity($entity);
        }
    }
1240005
public void addRootDTO(JavaClass<?> entity, JavaClassSource rootDTO)
   {
      DTOPair dtoPair = dtos.containsKey(entity) ? dtos.get(entity) : new DTOPair();
      dtoPair.rootDTO = rootDTO;
      dtos.put(entity, dtoPair);
   }
1154805
private static RepositorySystem newRepositorySystem() {
        return MavenRepositorySystemUtils.newServiceLocator()
                .addService(RepositoryConnectorFactory.class, BasicRepositoryConnectorFactory.class)
                .addService(TransporterFactory.class, FileTransporterFactory.class)
                .addService(TransporterFactory.class, HttpTransporterFactory.class)
                .getService(RepositorySystem.class);
    }
340372
public function save(AggregateRoot $aggregateRoot) : void
    {
        $this->getProperRepository($aggregateRoot->className())->save($aggregateRoot);
    }
754513
def _add_new_repo(repo, properties):
    '''
    
    '''
    repostr = '# ' if not properties.get('enabled') else ''
    repostr += 'src/gz ' if properties.get('compressed') else 'src '
    if ' ' in repo:
        repostr += '"' + repo + '" '
    else:
        repostr += repo + ' '
    repostr += properties.get('uri')
    repostr = _set_trusted_option_if_needed(repostr, properties.get('trusted'))
    repostr += '\n'
    conffile = os.path.join(OPKG_CONFDIR, repo + '.conf')

    with salt.utils.files.fopen(conffile, 'a') as fhandle:
        fhandle.write(salt.utils.stringutils.to_str(repostr))
1334946
public Repository addRepository(String name,
                                    String url) {
        Repository repository = new Repository(name, url);
        repositories.add(repository);
        return repository;
    }