Set if the items must be kept together if the section is invisible.

@param boolean $keepTogether true if the items must be kept together, false otherwise.
@throws \InvalidArgumentException If $keepTogether is not a boolean.
967642
public function setKeepTogether($keepTogether)
    {
        if (is_bool($keepTogether)) {
            $this->keepTogether = $keepTogether;
        } else {
            $msg = "KeepTogether must be a boolean, '" . gettype($keepTogether) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
965750
private function fetchFieldsContainsMany(array $fetchFields, FullyQualifiedClassName $section): bool
    {
        $sectionClass = (string) $section;
        $fields = $sectionClass::fieldInfo();
        foreach ($fetchFields as $fetchField) {
            if (!is_null($this->isManyRelationship($fetchField, $fields))) {
                return true;
            }
        }

        return false;
    }
567010
public function addItem(BreadcrumbItem $item): void
    {
        if ($this->items->contains($item)) {
            throw new InvalidArgumentException(sprintf('Item « %s » is already in breadcrumb', $item));
        }

        $this->items->forAll(function ($key, &$item) {
            $item->setCurrent(false);

            return true;
        });

        $item->setCurrent();
        $this->items->add($item);
    }
192052
protected function removeDir(
        /*# string */ $realPath,
        /*# bool */ $keep = false
    )/*# : bool */ {
        if ($keep || @rmdir($realPath)) {
            return true;
        } else {
            return $this->setError(
                Message::get(Message::STR_DELETE_FAIL, $realPath),
                Message::STR_DELETE_FAIL
            );
        }
    }
310269
public function setSectionIdentifier($sectionIdentifier)
    {
        if (Format::isIdentifier($sectionIdentifier) || empty($sectionIdentifier)) {
            $this->sectionIdentifier = $sectionIdentifier;
        } else {
            $msg = "'${sectionIndentifier}' is not a valid QTI Identifier.";
            throw new InvalidArgumentException($msg);
        }
    }
611458
public function add($item, $prepend = false)
    {
        if (!$item instanceof ChildNodeInterface) {
            $details = is_object($item) ? get_class($item) : gettype($item);
            throw new InvalidArgumentException(
                "NodeCollection accepts only objects implementing ChildNodeInterface, $details given."
            );
        }
        $old = $item->parent();
        if ($old === $this->parentNode) {
            return $this;
        } elseif ($old !== null) {
            $item->detach();
        }
        $this->checkUnlocked($item);
        parent::add($item, $prepend);
        $item->internalSetParent($this->parentNode);

        return $this;
    }
112979
public function setStability($stability)
    {
        if ($stability !== self::STABLE && $stability !== self::UNSTABLE && $stability !== self::ANY) {
            throw new InvalidArgumentException(
                'Invalid stability value. Must be one of "stable", "unstable" or "any".'
            );
        }
        $this->stability = $stability;
    }
959758
public function setPartOfRecord($partOfRecord)
    {
        if (is_bool($partOfRecord)) {
            $this->isPartOfRecord = $partOfRecord;
        } else {
            $msg = "The argument must be a boolean, '" . gettype($partOfRecord) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
64039
public function setData($data)
    {
        if ($data instanceof Collection || $data instanceof Model) {
            $this->data = $data->toArray();
        } elseif (is_array($data) || $data instanceof Repository) {
            $this->data = $data;
        } else {
            throw new \InvalidArgumentException('Data must be an array, a Collection, a Model or a Repository');
        }
    }
509534
public function setComment( $key, $comment, $section = NULL )
	{
		if( $this->usesSections() )
		{
			if( !$this->hasProperty( $key, $section ) )
				throw new InvalidArgumentException( 'Key "'.$key.'" is not existing in Section "'.$section.'".' );
			$this->comments[$section][$key] = $comment;
		}
		else
		{
			if( !$this->hasProperty( $key ) )
				throw new InvalidArgumentException( 'Key "'.$key.'" is not existing' );
			$this->comments[$key] = $comment;
		}
		return is_int( $this->write() );
	}
1043224
public function setHasFixtures($hasFixtures)
    {
        if (!is_bool($hasFixtures)) {
            throw new \InvalidArgumentException('The attribute hasFixtures on the class Entity has to be boolean (' . gettype($hasFixtures) . ('object' === gettype($hasFixtures) ? ' ' . get_class($hasFixtures) : '') . ' given).');
        }

        $this->hasFixtures = $hasFixtures;

        return $this;
    }
1210568
protected function persist(Item $item, Storage $storage, Label $label)
    {
        if (!$this->fs->exists($this->getTargetCover($item))) {
            $this->em->persist($item
                ->setStorage($storage)
                ->getItem()
                ->addLabel($label)
            );
            $this->fs->copy($this->getOriginCover($item), $this->getTargetCover($item));

            return true;
        }

        return false;
    }
757469
static function cleanDirectory($dirPath, $keepStructure = false)
    {
        $scanResult = static::scanDirectory($dirPath);
        if (!$scanResult) return false;

        try {
            foreach ($scanResult['files'] as $file) unlink($file);
            if (!$keepStructure) {
                krsort($scanResult['dirs']);
                foreach ($scanResult['dirs'] as $dir) rmdir($dir);
            }
            return true;
        } catch (\Throwable $throwable) {
            return false;
        }
    }
130268
public function set($sectionName, $itemName, $itemValue)
    {
        $section = $this->getSection($sectionName);
        $section->set($itemName, $itemValue);

        return $this;
    }
484165
protected function endSection()
    {
        if (empty($this->scope->sectionStack)) {
            throw new InvalidArgumentException('Cannot end a section without first starting one.');
        }

        $last = array_pop($this->scope->sectionStack);
        $this->storeSection($last, ob_get_clean());
    }
879425
public function init($keepalive = false)
        {
            $this->handshake();
            $this->connect();

            if ($keepalive) {
                $this->keepAlive();
            } else {
                return $this;
            }
        }
1137404
public function setForm($Form)
    {
        if (! is_object($Form) || ! $Form instanceof Helpers\Form) {
            throw new \InvalidArgumentException(
                'The Form Object must be a valid Helpers\Form Object'
            );
        }
        $this->Form = $Form;

        return true;
    }