@param WhereClauseStrategy $strategy

@return $this
330855
public function assignWhereAppliers(WhereClauseStrategy $strategy)
    {
        if ($this->whereAppliers) {
            $items = $strategy->getWhere();

            $strategy->clearWhere();

            foreach ($this->whereAppliers as $applier) {
                $clause = $this->connection()->where();

                call_user_func_array($applier, [$clause]);

                $strategy->whereConditions($clause);
            }

            if ($items) {
                $clause = $this->connection()->where();

                foreach ($items as $where) {
                    $clause->addWhere($where['logic'], $where['sql'], $where['params']);
                }

                $strategy->whereConditions($clause);
            }
        }

        return $this;
    }
427949
protected function prepareStrategies()
    {
        $strategy = new Strategy\AppConfigStrategy();
        $strategy->setObjectManager($this->objectManager);

        $this->addStrategy('AppConfig', $strategy);
    }
13303
protected function prepareStrategies()
    {
        $associations = $this->metadata->getAssociationNames();

        foreach ($associations as $association) {
            if ($this->metadata->isCollectionValuedAssociation($association)) {
                // Add a strategy if the association has none set by user
                if (! $this->hasStrategy($association)) {
                    if ($this->byValue) {
                        $strategyClassName = $this->getDefaultByValueStrategy();
                    } else {
                        $strategyClassName = $this->getDefaultByReferenceStrategy();
                    }

                    $this->addStrategy($association, new $strategyClassName());
                }

                $strategy = $this->getStrategy($association);

                if (! $strategy instanceof Strategy\AbstractCollectionStrategy) {
                    throw new InvalidArgumentException(
                        sprintf(
                            'Strategies used for collections valued associations must inherit from '
                            . 'Strategy\AbstractCollectionStrategy, %s given',
                            get_class($strategy)
                        )
                    );
                }

                $strategy->setCollectionName($association)
                         ->setClassMetadata($this->metadata);
            }
        }
    }
192029
protected function resolveStrategyClass($strategy)
    {
        if (empty($strategy)) {
            return false;
        }

        if ( ! str_contains($strategy, '.')) {
            $strategy = config($this->getAliasesBaseConfigKey() . $strategy, $strategy);
        }

        if (class_exists($strategy) && is_a($strategy, $this->getStrategyInterfaceClass(), true)) {
            return $strategy;
        }

        $strategy = $this->prefixStrategyNamespace($strategy);

        if (class_exists($strategy) && is_a($strategy, $this->getStrategyInterfaceClass(), true)) {
            return $strategy;
        }

        return false;
    }
659180
private function applyStorageStrategy(array &$mapping) : void
    {
        if (! isset($mapping['type']) || isset($mapping['id'])) {
            return;
        }

        switch (true) {
            case $mapping['type'] === 'int':
            case $mapping['type'] === 'float':
                $defaultStrategy   = self::STORAGE_STRATEGY_SET;
                $allowedStrategies = [self::STORAGE_STRATEGY_SET, self::STORAGE_STRATEGY_INCREMENT];
                break;

            case $mapping['type'] === 'many':
                $defaultStrategy   = CollectionHelper::DEFAULT_STRATEGY;
                $allowedStrategies = [
                    self::STORAGE_STRATEGY_PUSH_ALL,
                    self::STORAGE_STRATEGY_ADD_TO_SET,
                    self::STORAGE_STRATEGY_SET,
                    self::STORAGE_STRATEGY_SET_ARRAY,
                    self::STORAGE_STRATEGY_ATOMIC_SET,
                    self::STORAGE_STRATEGY_ATOMIC_SET_ARRAY,
                ];
                break;

            default:
                $defaultStrategy   = self::STORAGE_STRATEGY_SET;
                $allowedStrategies = [self::STORAGE_STRATEGY_SET];
        }

        if (! isset($mapping['strategy'])) {
            $mapping['strategy'] = $defaultStrategy;
        }

        if (! in_array($mapping['strategy'], $allowedStrategies)) {
            throw MappingException::invalidStorageStrategy($this->name, $mapping['fieldName'], $mapping['type'], $mapping['strategy']);
        }

        if (isset($mapping['reference']) && $mapping['type'] === 'many' && $mapping['isOwningSide']
            && ! empty($mapping['sort']) && ! CollectionHelper::usesSet($mapping['strategy'])) {
            throw MappingException::referenceManySortMustNotBeUsedWithNonSetCollectionStrategy($this->name, $mapping['fieldName'], $mapping['strategy']);
        }
    }
302282
public static function isAtomic(string $strategy) : bool
    {
        return $strategy === ClassMetadata::STORAGE_STRATEGY_ATOMIC_SET || $strategy === ClassMetadata::STORAGE_STRATEGY_ATOMIC_SET_ARRAY;
    }
563428
public function process( array $notifications, Strategy $strategy ) {

		/** @var Contract $one */
		$one = reset( $notifications );

		$subject    = $this->convert_tags( $one->get_subject() );
		$message    = $this->convert_tags( $one->get_message() );
		$merge_vars = $this->prepare_merge_vars( $notifications );
		$tos        = $this->prepare_to( $notifications );

		$args = array(
			'html'                => $message,
			'subject'             => $subject,
			'from_name'           => get_option( 'blogname' ),
			'from_email'          => get_option( 'admin_email' ),
			'to'                  => $tos,
			'auto_text'           => true,
			'merge_vars'          => $merge_vars,
			'preserve_recipients' => false
		);

		$args = wp_parse_args( $args, $this->defaults );

		if ( method_exists( $this->mandrill, 'messages_send' ) ) {
			$this->mandrill->messages_send( $args );
		} else {
			$this->mandrill->messages->send( $args );
		}

		foreach ( $notifications as $notification ) {
			$notification->set_strategy( new Null_Mail() )->send();
		}
	}
871140
public function make($strategy)
    {
        if ( ! $strategy) {
            return $this->getDefaultStrategy();
        }

        // If the strategy indicates the FQN of display strategy,
        // or a classname that can be found in the default strategy name path, use it.
        if ($strategyClass = $this->resolveStrategyClass($strategy)) {

            return app($strategyClass);
        }

        throw new RuntimeException("Could not create strategy instance for '{$strategy}'");
    }
121667
public function setSaveStrategy($strategy)
    {
        if (!in_array($strategy, [self::SAVE_APPEND, self::SAVE_REPLACE])) {
            $msg = sprintf('Invalid save strategy "%s"', $strategy);
            throw new InvalidArgumentException($msg);
        }

        $this->_saveStrategy = $strategy;

        return $this;
    }
1133084
public function registerStrategy($name, ConnectionStrategy $strategy, bool $default = false)
    {
        $this->connections[$name] = $strategy;

        if ($default) {
            $this->setDefaultConnectionName($name);
        }

        return $this;
    }
399497
public function authenticate($strategy)
    {
        return $this->getStrategy($strategy)
                    ->authenticate($this->request, $this->response);
    }
772977
public function attachErrorStrategy(AbstractErrorStrategy $strategy)
    {
        if ($strategy instanceof HtmlErrorStrategy) {
            $this->setDefaultErrorStrategy($strategy);

            return;
        }
        $this->strategies->attach($strategy);
    }
1244680
public function executeStrategyMethod($strategy, $method)
    {
        $strategy = $this->getStrategy($strategy);
        if (!$strategy) {
            return true;
        }

        return $this->explainer->displayBelow(function () use ($strategy, $method) {
            return $strategy->$method();
        });
    }
1235399
public void setInputLocalStrategy(int inputNum, LocalStrategy strategy) {
		this.config.setInteger(INPUT_LOCAL_STRATEGY_PREFIX + inputNum, strategy.ordinal());
	}
1025089
protected function resolveContextStrategyClass($strategy)
    {
        if ( ! empty($strategy)) {

            if ( ! str_contains($strategy, '.')) {
                $strategy = config('cms-models.strategies.repository.aliases.' . $strategy, $strategy);
            }

            if (class_exists($strategy) && is_a($strategy, ContextStrategyInterface::class, true)) {
                return $strategy;
            }

            $strategy = $this->prefixContextStrategyNamespace($strategy);

            if (class_exists($strategy) && is_a($strategy, ContextStrategyInterface::class, true)) {
                return $strategy;
            }
        }

        return false;
    }
874705
public function strategy($strategy = null)
    {
        if (is_null($strategy)) {
            $strategy = $this->defaultStrategy ?: OrderStrategy::class;
        }

        if (!class_exists($strategy)) {
            $strategy = __NAMESPACE__ . '\strategies\\' . ucfirst($strategy);
        }

        if (!class_exists($strategy)) {
            throw new InvalidArgumentException("Unsupported strategy \"{$strategy}\"");
        }

        if (empty($this->strategies[$strategy]) || !($this->strategies[$strategy] instanceof StrategyInterface)) {
            $this->strategies[$strategy] = new $strategy($this);
        }

        return $this->strategies[$strategy];
    }
969597
private function callWithStrategy()
    {
        if ($this->strategy instanceof StrategyInterface) {
            if ($this->strategy instanceof MatcherAwareInterface) {
                $this->strategy->setMatcher($this->matcher);
            }

            return $this->strategy->call($this);
        }

        throw new BadRouteException(str_replace("%s", get_class($this->strategy), BadRouteException::BAD_STRATEGY));
    }