Return a builder instance with the given behavior.

@param  string  $behavior
@return \Samrap\Acf\Fluent\Builder
2958
private function getBuilder($behavior)
    {
        // Create a new behavior of the given type if one does not yet exist.
        if (! isset($this->behaviors[$behavior])) {
            $this->behaviors[$behavior] = new $behavior();
        }

        return new Builder(new Runner($this->behaviors[$behavior]), $this->macros);
    }
231474
public function build(): SetBypassServiceWorkerRequest
	{
		$instance = new SetBypassServiceWorkerRequest();
		if ($this->bypass === null) {
			throw new BuilderException('Property [bypass] is required.');
		}
		$instance->bypass = $this->bypass;
		return $instance;
	}
1242414
def setBehavior(self, behavior, cascade=True):
        
        self.behavior = behavior
        if cascade:
            for obj in self.getChildren():
                obj.parentBehavior = behavior
                obj.autoBehavior(True)
1220710
public function build(): SetInstrumentationBreakpointRequest
	{
		$instance = new SetInstrumentationBreakpointRequest();
		if ($this->eventName === null) {
			throw new BuilderException('Property [eventName] is required.');
		}
		$instance->eventName = $this->eventName;
		return $instance;
	}
633989
public function build(): ReleaseObjectGroupRequest
	{
		$instance = new ReleaseObjectGroupRequest();
		if ($this->objectGroup === null) {
			throw new BuilderException('Property [objectGroup] is required.');
		}
		$instance->objectGroup = $this->objectGroup;
		return $instance;
	}
133974
public function addBehavior($bdata)
    {
        if ($bdata instanceof Behavior) {
            $behavior = $bdata;

            // the new behavior is already registered
            if ($this->hasBehavior($behavior->getId()) && $behavior->allowMultiple()) {
                // the user probably just forgot to specify the "id" attribute
                if ($behavior->getId() === $behavior->getName()) {
                    throw new BuildException(sprintf('Behavior "%s" is already registered. Specify a different ID attribute to register the same behavior several times.', $behavior->getName()));
                } else { // or he copy-pasted it and forgot to update it.
                    throw new BuildException(sprintf('A behavior with ID "%s" is already registered.', $behavior->getId()));
                }
            }

            $this->registerBehavior($behavior);
            $this->behaviors[$behavior->getId()] = $behavior;

            return $behavior;
        }

        $locator = $this->getBehaviorLocator();
        $class = $locator->getBehavior($bdata['name']);
        $behavior = new $class();
        if (!($behavior instanceof Behavior)) {
            throw new BuildException(sprintf('Behavior [%s: %s] not instance of %s',
                    $bdata['name'], $class, '\Propel\Generator\Model\Behavior'));
        }
        $behavior->loadMapping($bdata);

        return $this->addBehavior($behavior);
    }
873309
public function build(): SetAsyncCallStackDepthRequest
	{
		$instance = new SetAsyncCallStackDepthRequest();
		if ($this->maxDepth === null) {
			throw new BuilderException('Property [maxDepth] is required.');
		}
		$instance->maxDepth = $this->maxDepth;
		return $instance;
	}
163270
public function getBehavior($name)
    {
        if (false !== strpos($name, '\\')) {
            $class = $name;
        } else {
            $class = $this->getCoreBehavior($name);

            if (!class_exists($class)) {
                $behaviors = $this->getBehaviors();
                if (array_key_exists($name, $behaviors)) {
                    $class = $behaviors[$name]['class'];
                }
            }
        }

        if (!class_exists($class)) {
            throw new BehaviorNotFoundException(sprintf('Unknown behavior "%s". You may try running `composer update` or passing the `--composer-dir` option.', $name));
        }

        return $class;
    }
247199
public function build(): CloseTargetRequest
	{
		$instance = new CloseTargetRequest();
		if ($this->targetId === null) {
			throw new BuilderException('Property [targetId] is required.');
		}
		$instance->targetId = $this->targetId;
		return $instance;
	}
69
public function getBehaviors()
    {
        if (null === $this->behaviors) {
            // find behaviors in composer.lock file
            $lock = $this->findComposerLock();

            if (null === $lock) {
                $this->behaviors = [];
            } else {
                $this->behaviors = $this->loadBehaviors($lock);
            }

            // find behavior in composer.json (useful when developing a behavior)
            $json = $this->findComposerJson();

            if (null !== $json) {
                $behavior = $this->loadBehavior(json_decode($json->getContents(), true));

                if (null !== $behavior) {
                    $this->behaviors[$behavior['name']] = $behavior;
                }
            }
        }

        return $this->behaviors;
    }
927960
public function getConfiguredBehavior($name)
    {
        $propname = 'behavior' . ucfirst(strtolower($name)) . 'Class';
        try {
            $ret = $this->getClassname($propname);
        } catch (BuildException $e) {
            // class path not configured
            $ret = false;
        }

        return $ret;
    }
384166
public function build(): ReleaseAnimationsRequest
	{
		$instance = new ReleaseAnimationsRequest();
		if ($this->animations === null) {
			throw new BuilderException('Property [animations] is required.');
		}
		$instance->animations = $this->animations;
		return $instance;
	}
65192
public function addBehavior($bdata)
    {
        if ($bdata instanceof Behavior) {
            $behavior = $bdata;
            $behavior->setDatabase($this);
            $this->behaviors[$behavior->getName()] = $behavior;

            return $behavior;
        } else {
            $class = $this->getConfiguredBehavior($bdata['name']);
            $behavior = new $class();
            $behavior->loadFromXML($bdata);

            return $this->addBehavior($behavior);
        }
    }
929840
public function build($builder, $parameters) {
		$instance = $this->builder->build($builder, $parameters);

		return $instance;
	}
35125
public function build(): ReleaseSnapshotRequest
	{
		$instance = new ReleaseSnapshotRequest();
		if ($this->snapshotId === null) {
			throw new BuilderException('Property [snapshotId] is required.');
		}
		$instance->snapshotId = $this->snapshotId;
		return $instance;
	}
65867
public function apply(Builder $builder) : Builder
    {
        if ($this->hasRequest()) {
            foreach ($this->request as $filter => $value) {
                $this->resolveQueryFor($builder, $filter);
        	}
        }

        return $builder;
    }
886595
public function removeBehaviour(BehaviourAbstract $behaviour)
    {
        foreach ($this->behaviours as $key => $thisBehaviour) {
            if ($behaviour == $thisBehaviour) {
                unset($this->behaviours[$key]);
            }
        }
    }