@param ReportBuilder $builder

@return ReportBuilder
543918
public function applyTo(ReportBuilder $builder)
    {
        $builder->reportFilePath($this->getReportFileName());

        if ($this->isCoverageReportEmpty()) {
            return $builder;
        }

        return $this->applyReportResult($builder);
    }
686285
public function setQueryBuilder(\pwf\components\querybuilder\interfaces\SelectBuilder $builder)
    {
        $this->queryBuilder = $builder;
        return $this;
    }
970083
public function run(Builder $builder): Builder
    {
        return $builder->where('created_at', '>', $this->request->input('created_at.start'))
            ->where('created_at', '<', $this->request->input('created_at.end'));
    }
484995
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $this->addOnlineBankTransferType($builder, $options)
            ->addBankCountry($builder, $options);
    }
193985
protected function addBankAccount(FormBuilderInterface $builder)
    {
        $builder->add(
            static::FIELD_BANK_ACCOUNT,
            TextType::class,
            [
                'label' => false,
                'required' => true,
                'constraints' => [
                ],
            ]
        );

        return $this;
    }
108728
public static function builder($builder = null)
    {
        if (is_object($builder)) {
            self::$builder = $builder;
        }

        return isset(self::$builder) ? self::$builder : self::$builder = new Builder;
    }
134183
protected function getStatusColumn(Builder $builder)
    {
        if ($builder->getQuery()->joins && count($builder->getQuery()->joins) > 0) {
            return $builder->getModel()->getQualifiedStatusColumn();
        } else {
            return $builder->getModel()->getStatusColumn();
        }
    }
1137900
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        if ($this->getParent() === 'hidden') {
            $builder->addModelTransformer($this->transformer);
        }
    }
104648
public function addBuilder(BuilderInterface $builder)
    {
        $builder->setGenerator($this);
        $builder->setTemplateDirs($this->templateDirectories);
        $builder->setMustOverwriteIfExists($this->mustOverwriteIfExists);
        $builder->setVariables(array_merge($this->variables, $builder->getVariables()));

        $this->builders[] = $builder;

        return $builder;
    }
679326
public function setBuilder(AssertionBuilder $builder)
    {
        if ( ! is_null($this->builder) and $this->configuration["implicit_validation"]) {
            $this->go();
        }

        $this->builders[] = $builder;
        $this->builder = $builder;
    }
141885
public function search(Builder $builder)
    {
        try {
            return $this->performSearch($builder);
        } catch (IndexNotFoundException $e) {
            $this->initIndex($builder->model);
        }
    }
97467
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->addModelTransformer($this)
            ->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) use ($builder, $options) {
                $form = $event->getForm();
                $data = array(
                    'template_types' => null,
                    'templates' => array(),
                );

                // "templates"  field
                $templateFormBuilder = $builder->create('templates', null, array(
                    'compound' => true,
                    'auto_initialize' => false,
                ));
                $templateTypeChoices = array();

                // every template type got his own form
                foreach ($options['theme']->getTemplateTypes() as $templateType) {

                    // variation calculation
                    $variation = $this->variationResolver->resolve((new VariationContext())->denormalize(array(
                        'theme' => $options['theme'],
                        'content_type' => $contentType = $options['content_type'],
                        'template_type' => $templateType,
                    )));
                    if (!$templateType->supportsContentType(
                        $contentType->getName(),
                        $variation->getConfiguration('templates', $templateType->getName(), 'contents', array())
                    )) {
                        continue;
                    }

                    // template select entry
                    $templateTypeChoices[$templateType->getId()] = $templateType;

                    // template form construction
                    $template = $options['content']
                        ? $this->templateLoader->retrieveLocal($templateType, $options['content'])
                        : $this->templateLoader->retrieveGlobal($templateType, $contentType)
                    ;
                    if (!$template) {  // no template to edit : nothing to do
                        continue;
                    }

                    $data['templates'][$templateType->getName()] = $template;

                    $templateFormBuilder->add($templateType->getName(), TemplateType::class, array(
                        'auto_initialize' => false,
                        'content_type' => $options['content_type'],
                        'theme' => $options['theme'],
                        'template_type' => $templateType,
                        'variation' => $variation,
                    ));
                }

                $form
                    ->add('template_types', ChoiceType::class, array(
                        'required' => true,
                        'expanded' => false,
                        'auto_initialize' => false,
                        'choices' => $templateTypeChoices,
                        'mapped' => false,
                        'choice_value' => 'name',
                        'choice_label' => 'name',
                    ))
                    ->add($templateFormBuilder->getForm())
                ;

                $event->setData($data);
            })
        ;
    }
632295
public function run(Builder $builder): Builder
    {
        if ($builder->getQuery()->getConnection() instanceof PostgresConnection) {
            return $builder->whereRaw('content::TEXT ILIKE ?', '%'.$this->request->get('search').'%');
        }

        return $builder->where('content', 'LIKE', '%'.$this->request->get('search').'%');
    }
783435
public function onReportBuilder(ReportBuilderEvent $event)
    {
        if (!$event->checkContext([self::CONTEXT_CONTACT_LEDGER_CLIENT_STATS, self::CONTEXT_CONTACT_LEDGER_SOURCE_STATS])) {
            return;
        }

        if ($event->checkContext(self::CONTEXT_CONTACT_LEDGER_CLIENT_STATS)) {
            $this->onClientReportBuilder($event);
        }

        if ($event->checkContext(self::CONTEXT_CONTACT_LEDGER_SOURCE_STATS)) {
            $this->onSourceReportBuilder($event);
        }
    }
1089987
protected function writeTo( $builder, $writer )
    {
        $outputPath = $this->storagePath( 'output' );

        switch ($writer) {
            case 'array':
                return $builder->writeToArray();
            case 'collection':
                return $builder->writeToCollection();
            case 'csv':
                return $builder->writeToCSVFile( $outputPath . '.csv', function ( WriterConfigurator $configurator ) {
                    $configurator->setHeader( [ 'name', 'email' ] );
                } );
            case 'echo':
                return $builder->writeToEcho( function ( WriterConfigurator $configurator ) {
                    $configurator->setPrefix( 'PERSIST' );
                } );
            case 'excel':
                return $builder->writeToExcelFile( $outputPath . '.xlsx',
                    function ( WriterConfigurator $configurator ) {
                        $configurator->setHeader( [ 'name', 'email' ] );

                        $configurator->setTrailler( function ( WriterCallbackProxy $proxy ) {
                            $proxy->append( [ $proxy->getRecordCount() . ' records' ] );
                            $proxy->append( [ ( $proxy->getLineCount() + 1 ) . ' lines' ] );
                        } );

                        $configurator->setWorkbookConfigurator( function ( $workbook ) {
                            $workbook->setTitle( 'Workbook title' );
                            $workbook->setCreator( 'Creator' );
                            $workbook->setCompany( 'Company' );
                        } );

                        $configurator->setWorksheetConfigurator( function ( $worksheet ) {
                            $worksheet->setTitle( 'results', false );

                            $worksheet->setColumnFormat( [
                                'A' => Formats::text(),
                                'B' => Formats::general(),
                            ] );

                            // header
                            $worksheet->freezeFirstRow();
                            $worksheet->cells( 'A1:B1', function ( $cells ) {
                                $cells->setFontWeight( 'bold' );
                                $cells->setBorder( 'node', 'none', 'solid', 'none' );
                            } );
                            $worksheet->getStyle( 'A1:B1' )->getNumberFormat()->setFormatCode( Formats::text() );
                        } );
                    } );
            case 'html':
                return $builder->writeToHTMLTable( function ( WriterConfigurator $configurator ) {
                    $configurator->setHeader( [ 'name', 'email' ] );
                    $configurator->setTableClassAttribute( 'table table-condensed' );
                    $configurator->setTableIdAttribute( 'my-table' );
                } );
            case 'json':
                return $builder->writeToJSONFile( $outputPath . '.json' );
            case 'log':
                return $builder->writeToLog( function ( WriterConfigurator $configurator ) {
                    $configurator->setPrefix( 'PERSIST' );
                } );
            case 'pdo':
            case 'pdo-buffered':
                $pdo = $this->makeConnection();

                return $builder->writeToPDO( $pdo, 'users', [ 'name', 'email' ], $writer === 'pdo-buffered' );
            case 'text':
                return $builder->writeToTextFile( $outputPath . '.txt' );
            default:
                throw new InvalidArgumentException( 'Invalid writer' );
        }
    }
736567
public function handleBuilder($builder, $values)
    {
        return $builder->whereNotIn(
            $this->directiveArgValue('key', $this->definitionNode->name->value),
            $values
        );
    }
599512
public function onReportBuilder(ReportBuilderEvent $event)
    {
        $campaignPrefix          = 'c.';
        $campaignAliasPrefix     = 'c_';
        $campaignLeadPrefix      = 'cl.';
        $campaignLeadAliasPrefix = 'cl_';

        $utmPrefix      = 'u.';
        $utmAliasPrefix = 'u_';

        $columns = [
            $campaignPrefix.'name' => [
                'label' => 'mautic.campaignwatch.leadcampaign.header.name',
                'type'  => 'string',
                'alias' => $campaignAliasPrefix.'name',
            ],

            $campaignPrefix.'id' => [
                'label' => 'mautic.campaignwatch.leadcampaign.header.id',
                'type'  => 'string',
                'alias' => $campaignAliasPrefix.'id',
            ],

            $campaignPrefix.'is_published' => [
                'label' => 'mautic.campaignwatch.leadcampaign.header.ispublished',
                'type'  => 'int',
                'alias' => $campaignAliasPrefix.'is_published',
            ],

            $campaignLeadPrefix.'rotation' => [
                'label' => 'mautic.campaignwatch.leadcampaign.header.rotation',
                'type'  => 'string',
                'alias' => $campaignLeadAliasPrefix.'rotation',
            ],

            $campaignLeadPrefix.'manually_removed' => [
                'label' => 'mautic.campaignwatch.leadcampaign.header.manually_removed',
                'type'  => 'string',
                'alias' => $campaignLeadAliasPrefix.'manually_removed',
            ],

            $campaignLeadPrefix.'manually_added' => [
                'label' => 'mautic.campaignwatch.leadcampaign.header.manually_added',
                'type'  => 'string',
                'alias' => $campaignLeadAliasPrefix.'manually_added',
            ],

            $campaignLeadPrefix.'date_added' => [
                'label' => 'mautic.campaignwatch.leadcampaign.header.date_added',
                'type'  => 'string',
                'alias' => $campaignLeadAliasPrefix.'date_added',
            ],

            $utmPrefix.'utm_campaign' => [
                'label' => 'mautic.campaignwatch.leadcampaign.header.utm_campaign',
                'type'  => 'string',
                'alias' => $utmAliasPrefix.'utm_campaign',
            ],

            $utmPrefix.'utm_source' => [
                'label' => 'mautic.campaignwatch.leadcampaign.header.utm_source',
                'type'  => 'string',
                'alias' => $utmAliasPrefix.'utm_source',
            ],

            $utmPrefix.'utm_term' => [
                'label' => 'mautic.campaignwatch.leadcampaign.header.utm_term',
                'type'  => 'string',
                'alias' => $utmAliasPrefix.'utm_term',
            ],

            $utmPrefix.'utm_medium' => [
                'label' => 'mautic.campaignwatch.leadcampaign.header.utm_medium',
                'type'  => 'string',
                'alias' => $utmAliasPrefix.'utm_medium',
            ],

            $utmPrefix.'utm_content' => [
                'label' => 'mautic.campaignwatch.leadcampaign.header.utm_content',
                'type'  => 'string',
                'alias' => $utmAliasPrefix.'utm_content',
            ],
        ];

        $mergedColumns = array_merge(
            $this->fieldsBuilder->getLeadFieldsColumns('l.'),
            $columns
        );

        $data = [
            'display_name' => 'mautic.widget.leadcampaign.stats',
            'columns'      => $mergedColumns,
        ];
        $event->addTable(self::CONTEXT_CAMPAIGN_WATCH_LEADCAMPAIGN_STATS, $data, 'contacts');
    }