{@inheritDoc}
@see \rocket\ei\manage\draft\DraftProperty::supplyPersistDraftStmtBuilder()
508025
public function supplyPersistDraftStmtBuilder($value, $oldValue, PersistDraftStmtBuilder $persistDraftStmtBuilder, 
			PersistDraftAction $persistDraftAction) {
		ArgUtils::valObject($value, true);
		
		if ($value === null) {
			$persistDraftStmtBuilder->registerColumnRawValue(EiPropPath::from($this), null);
			return;
		}
		
		$em = $persistDraftAction->getQueue()->getEntityManager();
		if (!$em->contains($value)) {
			$em->persist($value);
		}
		
		$target = $this->eiPropRelation->getTargetEiType();
		
		$targetId = $target->extractId($value);
		if ($targetId === null) {
			$em->flush();
			$targetId = $target->extractId($value);
		}
		
		$persistDraftStmtBuilder->registerColumnRawValue(EiPropPath::from($this), 
				$target->idToPid($targetId));
	}
57964
protected function addDraft(Builder $builder): void
    {
        $builder->macro('draft', function (Builder $builder) {
            return $builder->update(['is_drafted' => 1]);
        });
    }
346262
private function getSerializedDraftData()
    {
        $currentDraft = $this->getContent()->getDraft();
        $this->getContent()->setDraft(null);

        $sourceData = $this->getContent()->jsonSerialize(self::JSON_CONCISE_FORMAT);
        $this->getContent()->setDraft($currentDraft);
        $draftData = parent::jsonSerialize(self::JSON_CONCISE_FORMAT);

        $draftData['uid'] = $sourceData['uid'];
        $draftData['type'] = $sourceData['type'];
        $draftData['elements'] = $this->computeElements($sourceData['elements'], $draftData['elements']);

        $parameters = [];
        foreach ($draftData['parameters'] as $key => $parameter) {
            if ($parameter['value'] !== $sourceData['parameters'][$key]['value']) {
                $parameters[$key] = [
                    'current' => $sourceData['parameters'][$key]['value'],
                    'draft'   => $parameter['value'],
                ];
            }
        }

        $draftData['parameters'] = $parameters;

        if ($this->getRevision() !== $this->getContent()->getRevision()) {
            $draftData['state'] = self::STATE_CONFLICTED;
        }

        return $draftData;
    }
834267
public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder();
        $rootNode = $treeBuilder->root('gearman');

        $rootNode
            ->children()
                ->arrayNode('bundles')
                    ->prototype('array')
                        ->children()
                            ->scalarNode('name')
                                ->isRequired()
                                ->cannotBeEmpty()
                            ->end()
                            ->booleanNode('active')
                                ->defaultFalse()
                            ->end()
                            ->arrayNode('include')
                                ->prototype('scalar')->end()
                            ->end()
                            ->arrayNode('ignore')
                                ->prototype('scalar')->end()
                            ->end()
                        ->end()
                    ->end()
                ->end()
                ->arrayNode('resources')
                    ->scalarPrototype()->end()
                ->end()
                ->arrayNode('servers')
                    ->performNoDeepMerging()
                    ->defaultValue(array(
                        'localhost' =>  array(
                            'host'  =>  '127.0.0.1',
                            'port'  =>  '4730',
                        ),
                    ))
                    ->prototype('array')
                        ->children()
                            ->scalarNode('host')
                                ->isRequired()
                                ->cannotBeEmpty()
                            ->end()
                            ->integerNode('port')
                                ->defaultValue('4730')
                            ->end()
                        ->end()
                    ->end()
                ->end()
                ->arrayNode('defaults')
                    ->addDefaultsIfNotSet()
                    ->children()
                        ->integerNode('iterations')
                            ->min(0)
                            ->defaultValue(0)
                        ->end()
                        ->scalarNode('method')
                            ->defaultValue('doNormal')
                        ->end()
                        ->booleanNode('callbacks')
                            ->defaultTrue()
                        ->end()
                        ->scalarNode('job_prefix')
                            ->defaultNull()
                        ->end()
                        ->booleanNode('generate_unique_key')
                            ->defaultTrue()
                        ->end()
                        ->booleanNode('workers_name_prepend_namespace')
                            ->defaultTrue()
                        ->end()
                        ->integerNode('minimum_execution_time')
                            ->min(0)
                            ->defaultValue(0)
                        ->end()
                        ->integerNode('timeout')
                            ->min(0)
                            ->defaultValue(0)
                        ->end()
                    ->end()
                ->end()
            ->end();

        return $treeBuilder;
    }
1183082
@Override
    public CriteriaBuilder getCriteriaBuilder()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            Tr.debug(tc, "getCriteriaBuilder : " + this);
        throw new UnsupportedOperationException("This operation is not supported on a pooling EntityManagerFactory.");
    }
117715
public function handleBuilder($builder, $value)
    {
        foreach ($value as $orderByClause) {
            $builder->orderBy(
                $orderByClause['field'],
                $orderByClause['order']
            );
        }

        return $builder;
    }
298599
public function buildIterator()
    {
        $qb = $this->em->createQueryBuilder();
        $qb->select('fs')
            ->from('KunstmaanFormBundle:FormSubmission', 'fs')
            ->innerJoin('fs.node', 'n', 'WITH', 'fs.node = n.id')
            ->andWhere('n.id = :node')
            // only export the requested language, bc headers aren't translated correctly
            ->andWhere('fs.lang = :lang')
            ->setParameter('node', $this->nodeTranslation->getNode()->getId())
            ->setParameter('lang', $this->nodeTranslation->getLang())
            ->addOrderBy('fs.created', 'DESC');
        $iterableResult = $qb->getQuery()->iterate();
        $isHeaderWritten = false;

        $collection = new ArrayCollection();
        $i = 0;
        foreach ($iterableResult as $row) {
            /* @var FormSubmission $submission */
            $submission = $row[0];

            // Write row data
            $data = [
                'id' => $submission->getId(),
                'date' => $submission->getCreated()->format('d/m/Y H:i:s'),
                'language' => $submission->getLang(),
            ];
            foreach ($submission->getFields() as $field) {
                if (!$isHeaderWritten) {
                    $this->addExportField($field->getFieldName(), $this->translator->trans($field->getLabel()));
                }
                $data[$field->getFieldName()] = $field->__toString();
            }
            $isHeaderWritten = true;
            $collection->add([$data]);

            if (($i % $this->batchSize) === 0) {
                $this->em->clear();
            }
            ++$i;
        }

        $this->iterator = $collection->getIterator();
    }
805902
public function build(): RequestEntriesRequest
	{
		$instance = new RequestEntriesRequest();
		if ($this->cacheId === null) {
			throw new BuilderException('Property [cacheId] is required.');
		}
		$instance->cacheId = $this->cacheId;
		if ($this->skipCount === null) {
			throw new BuilderException('Property [skipCount] is required.');
		}
		$instance->skipCount = $this->skipCount;
		if ($this->pageSize === null) {
			throw new BuilderException('Property [pageSize] is required.');
		}
		$instance->pageSize = $this->pageSize;
		$instance->pathFilter = $this->pathFilter;
		return $instance;
	}
77179
protected function addWithoutDrafted(Builder $builder): void
    {
        $builder->macro('withoutDrafted', function (Builder $builder) {
            return $builder->withoutGlobalScope($this)->where('is_drafted', 0);
        });
    }
425712
public function getConfigTreeBuilder()
    {
        return (new TreeBuilder())
            ->root('gpslab_domain_event')
                ->children()
                    ->scalarNode('bus')
                        ->cannotBeEmpty()
                        ->defaultValue('listener_located')
                    ->end()
                    ->scalarNode('queue')
                        ->cannotBeEmpty()
                        ->defaultValue('pull_memory')
                    ->end()
                    ->scalarNode('locator')
                        ->cannotBeEmpty()
                        ->defaultValue('symfony')
                    ->end()
                    ->booleanNode('publish_on_flush')
                        ->defaultValue(false)
                    ->end()
                ->end()
            ->end()
        ;
    }
1255600
public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder();
        $rootNode = $treeBuilder->root('m6web_cassandra');

        $rootNode
            ->children()
                ->booleanNode('dispatch_events')->defaultValue(true)->end()
                ->arrayNode('clients')
                    ->isRequired()
                    ->requiresAtLeastOneElement()
                    ->useAttributeAsKey('id', false)
                    ->prototype('array')
                        ->beforeNormalization()
                            ->ifTrue(function ($v) {
                                return (array_key_exists('load_balancing', $v) &&   $v['load_balancing'] === 'dc-aware-round-robin') && !array_key_exists('dc_options', $v);
                            })
                            ->thenInvalid('"dc-aware-round-robin" load balancing option require a "dc_options" entry in your configuration')
                        ->end()
                        ->children()
                            ->booleanNode('persistent_sessions')->defaultValue(true)->end()
                            ->scalarNode('keyspace')->defaultValue(null)->end()
                            ->scalarNode('load_balancing')
                                ->defaultValue('round-robin')
                                ->validate()
                                    ->ifNotInArray(['round-robin', 'dc-aware-round-robin'])
                                    ->thenInvalid('Invalid load balancing value "%s"')
                                ->end()
                            ->end()
                            ->arrayNode('dc_options')
                                ->children()
                                    ->scalarNode('local_dc_name')->isRequired()->cannotBeEmpty()->end()
                                    ->integerNode('host_per_remote_dc')->isRequired()->min(1)->end()
                                    ->booleanNode('remote_dc_for_local_consistency')->isRequired()->end()
                                ->end()
                            ->end()
                            ->scalarNode('default_consistency')
                                ->defaultValue('one')
                                ->validate()
                                    ->ifNotInArray(['one', 'any', 'two', 'three', 'quorum', 'all', 'local_quorum', 'each_quorum', 'serial', 'local_serial', 'local_one'])
                                    ->thenInvalid('Invalid consistency value "%s"')
                                ->end()
                            ->end()
                            ->scalarNode('default_pagesize')
                                ->defaultValue(10000)
                                ->validate()
                                    ->ifTrue(function ($v) {
                                        return !is_null($v) && (!is_int($v) || $v <= 0);
                                    })
                                    ->thenInvalid('Expected positive integer or null value')
                                ->end()
                            ->end()
                            ->arrayNode('contact_endpoints')->isRequired()->requiresAtLeastOneElement()->performNoDeepMerging()
                                ->prototype('scalar')->end()
                            ->end()
                            ->arrayNode('contact_whitelist')
                                ->addDefaultsIfNotSet()
                                ->children()
                                    ->arrayNode('dc')->defaultValue([])->prototype('scalar')->end()->end()
                                    ->arrayNode('host')->defaultValue([])->prototype('scalar')->end()->end()
                                ->end()
                            ->end()
                            ->arrayNode('contact_blacklist')
                                ->addDefaultsIfNotSet()
                                ->children()
                                    ->arrayNode('dc')->defaultValue([])->prototype('scalar')->end()->end()
                                    ->arrayNode('host')->defaultValue([])->prototype('scalar')->end()->end()
                                ->end()
                            ->end()
                            ->integerNode('port_endpoint')->defaultValue(9042)->end()
                            ->booleanNode('token_aware_routing')->defaultValue(true)->end()
                            ->arrayNode('credentials')
                                ->children()
                                    ->scalarNode('username')->isRequired()->cannotBeEmpty()->end()
                                    ->scalarNode('password')->isRequired()->cannotBeEmpty()->end()
                                ->end()
                            ->end()
                            ->booleanNode('ssl')->defaultValue(false)->end()
                            ->integerNode('default_timeout')->min(1)->end()
                            ->arrayNode('timeout')
                                ->addDefaultsIfNotSet()
                                ->children()
                                    ->integerNode('connect')->isRequired()->defaultValue(5)->min(1)->end()
                                    ->integerNode('request')->isRequired()->defaultValue(5)->min(1)->end()
                                ->end()
                            ->end()
                            ->arrayNode('retries')
                                ->addDefaultsIfNotSet()
                                ->children()
                                    ->integerNode('sync_requests')->defaultValue(0)->end()
                                ->end()
                            ->end()
                        ->end()
                    ->end()
                ->end()
            ->end();

        return $treeBuilder;
    }
734392
protected function addUndoDraft(Builder $builder): void
    {
        $builder->macro('undoDraft', function (Builder $builder) {
            $builder->withDrafted();

            return $builder->update(['drafted_at' => null]);
        });
    }
224041
public function getConfigTreeBuilder()
    {
        $builder = new TreeBuilder();

        $rootNode = $builder->root('best_it_ct_order_export');

        $rootNode
            ->children()
                ->arrayNode('commercetools_client')
                    ->isRequired()
                    ->children()
                        ->scalarNode('id')->cannotBeEmpty()->isRequired()->end()
                        ->scalarNode('secret')->cannotBeEmpty()->isRequired()->end()
                        ->scalarNode('project')->cannotBeEmpty()->isRequired()->end()
                        ->scalarNode('scope')->cannotBeEmpty()->isRequired()->end()
                    ->end()
                ->end()
                ->scalarNode('filesystem')
                    ->info('Please provide the service id for your flysystem file system.')
                    ->isRequired()
                ->end()
                ->scalarNode('logger')
                    ->info('Please provide the service id for your logging service.')
                    ->defaultValue('logger')
                ->end()
                ->arrayNode('orders')
                    ->children()
                        ->booleanNode('with_pagination')
                            ->defaultValue(true)
                            ->info(
                                'Should we use a paginated list of orders (or is the result list changing by "itself")?'
                            )
                        ->end()
                        ->arrayNode('default_where')
                            ->info(
                                'Add where clauses for orders: ' .
                                    'https://dev.commercetools.com/http-api-projects-orders.html#query-orders'
                            )
                            ->prototype('scalar')->end()
                        ->end()
                        ->scalarNode('file_template')
                            ->info('Which template is used for the export of a single order?')
                            ->defaultValue('detail.xml.twig')
                        ->end()
                        ->scalarNode('name_scheme')
                            ->defaultValue('order_{{id}}_{{YmdHis}}.xml')
                            ->info(
                                'Provide an order field name or a format string for the date function enclosed ' .
                                'with {{ and }}.'
                            )
                        ->end()
                    ->end()
                ->end();

        return $builder;
    }
416645
public static function get(int $draftShareInviteBankId, array $customHeaders = []): BunqResponseDraftShareInviteBank
    {
        $apiClient = new ApiClient(static::getApiContext());
        $responseRaw = $apiClient->get(
            vsprintf(
                self::ENDPOINT_URL_READ,
                [static::determineUserId(), $draftShareInviteBankId]
            ),
            [],
            $customHeaders
        );

        return BunqResponseDraftShareInviteBank::castFromBunqResponse(
            static::fromJson($responseRaw, self::OBJECT_TYPE_GET)
        );
    }
1000852
def article2draft(article):
    ''''''
    draft = Draft(article._content, article.metadata, article.settings,
                  article.source_path, article._context)
    draft.status = 'draft'
    return draft
680156
@Override
  public QueueDeliver<M> build(Supplier<Deliver<M>> factory, 
                               int workerCount)
  {
    Objects.requireNonNull(factory);
    validateBuilder();
    
    if (workerCount <= 0) {
      throw new IllegalArgumentException();
    }
    
    if (workerCount == 1) {
      return build(factory.get());
    }

    QueueRing<M> queueDeliver = buildQueue();
    
    //Objects.requireNonNull(processors);
      
    @SuppressWarnings("unchecked")
    WorkerDeliver<M>[] workers = new WorkerDeliver[workerCount];
      
    Executor executor = createExecutor();
    ClassLoader loader = getClassLoader();
      
    for (int i = 0; i < workers.length; i++) {
      Deliver<M> deliver = factory.get();
      
      workers[i] = new WorkerDeliverMultiThread<M>(deliver,
                                                   _outboxContext,
                                                   executor, loader, 
                                                   queueDeliver);
    }
      
    WorkerDeliver<M> worker
      = new WorkerDeliverMultiCoordinator<>(queueDeliver, 
                                          workers,
                                          multiworkerOffset());
    
    return new QueueDeliverImpl<M>(queueDeliver, worker);
  }
766420
public function addDraftDocuments(\AgentSIB\Diadoc\Api\Proto\Events\DraftDocumentToPatch $value)
    {
        if ($this->DraftDocuments === null) {
            $this->DraftDocuments = new \Protobuf\MessageCollection();
        }

        $this->DraftDocuments->add($value);
    }