@param string $strategy one of "LAZY", "EAGER", "EXTRA_LAZY"

@return $this
484927
public function fetch($strategy)
    {
        $method = 'fetch'.Inflector::classify(strtolower($strategy));

        if (!method_exists($this->association, $method)) {
            throw new InvalidArgumentException('Fetch ['.$strategy.'] does not exist');
        }

        $this->{$method}();

        return $this;
    }
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];
    }
428241
public static function encode($strategy, $value)
	{
		switch ($strategy) {
			case 'explode':
				return implode(',', $value);
			case 'json':
				return json_encode($value);
			case 'serialize':
				return serialize($value);
		}

		return $value;
	}
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']);
        }
    }
632775
public static function usesSet(string $strategy) : bool
    {
        return in_array(
            $strategy,
            [
                ClassMetadata::STORAGE_STRATEGY_SET,
                ClassMetadata::STORAGE_STRATEGY_SET_ARRAY,
                ClassMetadata::STORAGE_STRATEGY_ATOMIC_SET,
                ClassMetadata::STORAGE_STRATEGY_ATOMIC_SET_ARRAY,
            ]
        );
    }
828278
public function findElement($strategy, $selector)
	{
		return $this->element($this->using($strategy)->value($selector));
	}
1102985
public function havingConditions($strategy)
    {
        $instance = $this->havingStrategyInstance();

        $instance->havingStrategy()->havingConditions($strategy);

        return $instance;
    }
731223
public function whereConditions($strategy)
    {
        $instance = $this->whereStrategyInstance();

        $instance->whereStrategy()->whereConditions($strategy);

        return $instance;
    }
277570
public function getNamer($strategy)
    {
        if (!isset($this->namingMap[$strategy])) {
            throw new NoSuchNamingException(sprintf('The naming strategy "%s" does not exist', $strategy));
        }

        return $this->namingMap[$strategy];
    }
436125
public function make($strategy, array $options = [])
    {
        $instance = $this->instantiateClass(
            $this->resolveStrategyClassName($strategy)
        );

        if ( ! ($instance instanceof VariantStrategyInterface)) {
            throw new RuntimeException("Variant strategy created for '{$strategy}' is of incorrect type");
        }

        return $instance->setOptions($options);
    }
759209
public JsonSet withIdStrategy(IdStrategy strategy) {
        this.strategy = strategy;
        if(size()>0) {
            JsonSet seen=new JsonSet().withIdStrategy(strategy);
            Iterator<JsonElement> iterator = this.iterator();
            while (iterator.hasNext()) {
                JsonElement e = iterator.next();
                if(seen.contains(e)) {
                    iterator.remove();
                } else {
                    seen.add(e);
                }
            }
        }
        return this;
    }
893206
public function findElements($strategy, $selector)
	{
		$this->modifyCriteria($strategy, $selector);
		return $this->getRoot()->findElements($strategy, $selector);
	}
1056804
public function assignHavingAppliers(HavingClauseStrategy $strategy)
    {
        if ($this->havingAppliers) {
            $items = $strategy->getHaving();

            $strategy->clearHaving();

            foreach ($this->havingAppliers as $applier) {
                $clause = $this->connection()->having();

                call_user_func_array($applier, [$clause]);

                $strategy->havingConditions($clause);
            }

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

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

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

        return $this;
    }
1108492
public function orWhereConditions($strategy)
    {
        $instance = $this->whereStrategyInstance();

        $instance->whereStrategy()->orWhereConditions($strategy);

        return $instance;
    }
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}'");
    }
1220854
public function findElement($strategy, $selector)
	{
		$this->modifyCriteria($strategy, $selector);
		return $this->getRoot()->findElement($strategy, $selector);
	}
1029804
protected function getStrategy()
	{
		if (is_null($this->strategy))
		{
			$this->strategy = new Strategy\DateTimeStrategy;
		}

		return $this->strategy;
	}