Automatique registry builder from the current entity object.
481079
private function buildRegistryFromObject()
    {
        if (!($this->entity instanceof DomainObjectInterface)) {
            throw new \Exception('EntityRegistry have to implement DomainObjectInterface', 1);
        }
        $this->classname = get_class($this->entity);

        $identifier = new Registry();
        $this->registries[] = $identifier->setType($this->classname)->setKey('identifier')->setValue($this->entity->getObjectIdentifier());

        foreach ($this->entity->getObjectProperties() as $key => $value) {
            $registry = new Registry();
            $this->registries[] = $registry->setType($this->classname)->setKey($key)->setValue($value)->setScope($this->entity->getObjectIdentifier());
        }
    }
1028051
@Override
	public void processGeneration(Object entity, Field field) {

		// Si on ne doit pas evaluer cette annotation
		if(!this.isProcessable()) {
			
			// On sort
			return;
		}
		
		// On caste l'annotation
		FieldGenerator castedAnnotation = (FieldGenerator) this.annotation;
		
		// Classe de generation
		Class<? extends IFieldGenerator> generatorClass = castedAnnotation.generator();
		
		// Instanciation de la classe
		IFieldGenerator generator = null;
		
		try {
			
			// Instanciation de la classe
			generator = generatorClass.newInstance();
			
		} catch (Exception e) {
			
			// On relance
			throw new RuntimeException("jpersistencetools.generator.classbased.error.instanciate", e);
		}
		
		// Initialisation du gestionnaire d'entites
		generator.setEntityManager(entityManager);
		
		// Positionnement du gestionnaire d'entites de generation
		generator.setGeneratorEntityManager(generatorEntityManager);
		
		// Positionnement du champ a mettre a jour
		generator.setField(field);
		
		// Positionnement de l'entite
		generator.setEntity(entity);
		
		// Initialisation du generateur
		generator.initialize();
		
		// Generation
		Serializable generatedValue = generator.generate();
		
		try {
			
			// Obtention du descripteur de proprietes pour cette propriete
			PropertyDescriptor propertyDescriptor = new PropertyDescriptor(field.getName(), entity.getClass());
			
			// Obtention du setter
			Method propertySetter = propertyDescriptor.getWriteMethod();
			
			// Invocation du setter
			propertySetter.invoke(entity, generatedValue);
			
		} catch (Exception e) {
			
			// On relance
			throw new RuntimeException("jpersistencetools.generator.classbased.error.update.field", e);
		}
	}
396449
def read(self, entity=None, attrs=None, ignore=None, params=None):
        """"""
        if attrs is None:
            attrs = self.read_json()
        if ignore is None:
            ignore = set()
        ignore.add('password')
        return super(Registry, self).read(entity, attrs, ignore, params)
699573
function injectRegistry(entry) {
  const extraFiles = [registryFile, actBuildInfoFile, actMetaData];
  // build also the registry
  if (typeof entry === 'string') {
    return extraFiles.concat(entry);
  }
  const transformed = {};
  Object.keys(entry).forEach((eentry) => {
    transformed[eentry] = extraFiles.concat(entry[eentry]);
  });
  return transformed;
}
1084669
def create(self, model_obj):
        """"""
        # Update the value of the counters
        model_obj = self._set_auto_fields(model_obj)

        # Add the entity to the repository
        identifier = model_obj[self.entity_cls.meta_.id_field.field_name]
        with self.conn['lock']:
            self.conn['data'][self.schema_name][identifier] = model_obj

        return model_obj
1311578
private function buildRegistries()
    {
        if (is_object($this->entity) && $this->isRegistryEntity($this->entity)) {
            $this->buildRegistryFromObject();
        } else {
            throw new \InvalidArgumentException(sprintf(
                'Cannot build registries: current entity must be an instance of %s, current `%s`.',
                'BackBee\Bundle\Registry\RegistryEntityInterface',
                gettype($this->entity)
            ));
        }

        foreach ($this->registries as $registry) {
            $this->entity->{$registry->getKey()} = $registry->getValue();
        }
    }
812369
def as_repository(resource):
    
    reg = get_current_registry()
    if IInterface in provided_by(resource):
        resource = reg.getUtility(resource, name='collection-class')
    return reg.getAdapter(resource, IRepository)
672645
public function autodiscover(): void
    {
        $entityMappings = [];
        foreach ($this->fileSystem->getEntityDirectories() as $entityDirectory) {
            $namespace = $this->namespaceDetector->detectFromDirectory($entityDirectory);
            if (! $namespace) {
                continue;
            }

            $entityMappings[] = [
                'name' => $namespace, // required name
                'prefix' => $namespace,
                'type' => 'annotation',
                'dir' => $entityDirectory->getRealPath(),
                'is_bundle' => false, // performance
            ];
        }

        $xmlNamespaces = [];

        $directoryByNamespace = $this->resolveDirectoryByNamespace($this->fileSystem->getEntityXmlFiles());
        foreach ($directoryByNamespace as $namespace => $directory) {
            if (in_array($namespace, $xmlNamespaces, true)) {
                continue;
            }

            $xmlNamespaces[] = $namespace;

            $entityMappings[] = [
                'name' => $namespace, // required name
                'prefix' => $namespace,
                'type' => 'xml',
                'dir' => $directory,
                'is_bundle' => false,
            ];
        }

        if (! count($entityMappings)) {
            return;
        }

        // @see https://symfony.com/doc/current/reference/configuration/doctrine.html#mapping-entities-outside-of-a-bundle
        $this->containerBuilder->prependExtensionConfig('doctrine', [
            'orm' => ['mappings' => $entityMappings],
        ]);
    }
603703
def get_registry(entry, runtime):
    """"""
    try:
        records_location_param_id = Id('parameter:recordsRegistry@mongo')
        registry = runtime.get_configuration().get_value_by_parameter(
            records_location_param_id).get_string_value()
        return import_module(registry).__dict__.get(entry, {})
    except (ImportError, AttributeError, KeyError, NotFound):
        return {}
1064000
function RegistryWrapper(obj, type) {
  this.obj = obj;
  this.type = type;

  this.selected = false;
  this.collapsed = false;
  this.customEvents = [];

  this.debugName = obj.getDebugName();

  if (obj.el) {
    this.elString = Object.prototype.toString.call(obj.el);
  }

  if (typeof obj.getFunctions === 'function') {
    this.trackedFunctions = {};
    this.objectFunctions = obj.getFunctions(this.trackedFunctions, getTrackableFunction);
  }

  // Add history tracking to top level views
  if (type === 'views' && typeof obj.getState === 'function' && !obj.parentView) {
    this.state = new StateHistory(obj);
  }

  if (typeof obj.getEvents === 'function') {
    this.objectEvents = obj.getEvents();
  }

  _.bindAll(this, 'isParent', 'getChildren');
}
1069893
def build(self, builder):
        """"""

        params = dict(OID=self.oid, Name=self.name)
        if self.field_number is not None:
            params["FieldNumber"] = str(self.field_number)

        builder.start("mdsol:LabelDef", params)

        for translation in self.translations:
            translation.build(builder)

        for view_restriction in self.view_restrictions:
            view_restriction.build(builder)

        builder.end("mdsol:LabelDef")
748939
def _from_dict(cls, _dict):
        """"""
        args = {}
        if 'generic' in _dict:
            args['generic'] = [
                DialogRuntimeResponseGeneric._from_dict(x)
                for x in (_dict.get('generic'))
            ]
        if 'intents' in _dict:
            args['intents'] = [
                RuntimeIntent._from_dict(x) for x in (_dict.get('intents'))
            ]
        if 'entities' in _dict:
            args['entities'] = [
                RuntimeEntity._from_dict(x) for x in (_dict.get('entities'))
            ]
        if 'actions' in _dict:
            args['actions'] = [
                DialogNodeAction._from_dict(x) for x in (_dict.get('actions'))
            ]
        if 'debug' in _dict:
            args['debug'] = MessageOutputDebug._from_dict(_dict.get('debug'))
        if 'user_defined' in _dict:
            args['user_defined'] = _dict.get('user_defined')
        return cls(**args)
395765
public static function getObjectManager(ManagerRegistry $registry, $entity, Constraint $constraint)
    {
        self::validateConstraint($constraint);
        /* @var UniqueEntity $constraint */

        return self::findObjectManager($registry, $entity, $constraint);
    }
1054006
public static void update(Registry registry) {
    Iterator<Map.Entry<Id, Object>> iter = registry.state().entrySet().iterator();
    while (iter.hasNext()) {
      Map.Entry<Id, Object> entry = iter.next();
      if (entry.getValue() instanceof AbstractMeterState) {
        AbstractMeterState tuple = (AbstractMeterState) entry.getValue();
        tuple.doUpdate(registry);
        if (tuple.hasExpired()) {
          iter.remove();
        }
      }
    }
  }
766697
def new_registry(attribute=None):
    
    registry = {}

    def register(key):
        def decorator(func):
            registry[key] = func
            if attribute:
                setattr(func, attribute, key)
            return func
        return decorator

    return registry, register
1281469
public static <E> JpaRepositoryConfig.Builder<E> builder(Class<E> entityClass) {
        JpaRepositoryConfig.Builder<E> builder = new JpaRepositoryConfig.Builder<>();
        builder.entityClass = entityClass;
        builder.resourceClass = entityClass;
        return builder;
    }
658647
def perform_create(self, serializer):
        """"""
        process = serializer.validated_data.get('process')
        if not process.is_active:
            raise exceptions.ParseError(
                'Process retired (id: {}, slug: {}/{}).'.format(process.id, process.slug, process.version)
            )

        with transaction.atomic():
            instance = serializer.save()

            assign_contributor_permissions(instance)

            # Entity is added to the collection only when it is
            # created - when it only contains 1 Data object.
            entities = Entity.objects.annotate(num_data=Count('data')).filter(data=instance, num_data=1)

            # Assign data object to all specified collections.
            collection_pks = self.request.data.get('collections', [])
            for collection in Collection.objects.filter(pk__in=collection_pks):
                collection.data.add(instance)
                copy_permissions(collection, instance)

                # Add entities to which data belongs to the collection.
                for entity in entities:
                    entity.collections.add(collection)
                    copy_permissions(collection, entity)