{@inheritdoc}

@throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException
542860
public function handle(
        CriteriaConverter $converter,
        SelectQuery $query,
        Criterion $criterion,
        array $languageSettings
    )
    {
        /** @var \eZ\Publish\API\Repository\Values\Content\Query\Criterion $filter */
        $filter = $criterion->value;
        $subSelect = $query->subSelect();
        $condition = $this->locationCriteriaConverter->convertCriteria($subSelect, $filter, []);

        $subSelect
            ->select('ezcontentobject_tree.contentobject_id')
            ->from($this->dbHandler->quoteTable('ezcontentobject_tree'))
            ->innerJoin(
                $this->dbHandler->quoteTable('ezcontentobject'),
                $this->dbHandler->quoteColumn('contentobject_id', 'ezcontentobject_tree'),
                $this->dbHandler->quoteColumn('id', 'ezcontentobject')
            )
            ->innerJoin(
                $this->dbHandler->quoteTable('ezcontentobject_version'),
                $this->dbHandler->quoteColumn('id', 'ezcontentobject'),
                $this->dbHandler->quoteColumn('contentobject_id', 'ezcontentobject_version')
            )
            ->where(
                $condition,
                //ContentInfo::STATUS_PUBLISHED
                $subSelect->expr->eq(
                    'ezcontentobject.status',
                    $subSelect->bindValue(1, null, PDO::PARAM_INT)
                ),
                //VersionInfo::STATUS_PUBLISHED
                $subSelect->expr->eq(
                    'ezcontentobject_version.status',
                    $subSelect->bindValue(1, null, PDO::PARAM_INT)
                )
            );

        return $query->expr->in(
            $this->dbHandler->quoteColumn('id', 'ezcontentobject'),
            $subSelect
        );
    }
105659
public function execute( $query ) {
		if ( $query instanceof QueryBuilder ) {
			$query = $query->getSPARQL();
		}

		if ( !is_string( $query ) ) {
			throw new InvalidArgumentException( '$query has to be a string or an instance of QueryBuilder' );
		}

		$result = $this->getResult( $query );
		
		// TODO also support ask queries (with key 'boolean')
		//      https://www.w3.org/TR/rdf-sparql-json-res/
		return $result['results'];
	}
306872
protected function execute(InputInterface $input, OutputInterface $output)
    {
        //  validate the content types unless validation is ignored

        if ($input->getArgument('id') && !$input->getOption('ignore')) {
            $code = $this->executeValidation($input, $output);

            if ($code) {
                return $code;
            }
        }

        if ($input->getOption('delete')) {
            return $this->executeDelete($input, $output);
        }

        if (!$input->getArgument('id') && !$input->getOption('full')) {
            throw new InvalidArgumentException(
                'You need to give one or more content types or choose the --full or --delete option'
            );
        }

        return $this->executeIndex($input, $output);
    }
1366869
public function execute(array $input)
    {
        $text = $this->textSanitizer->sanitize($input);
        $location = $this->locationSanitizer->sanitize($input);

        if (!is_callable($input['replacement'])) {
            throw new InvalidArgumentException('Invalid replacement');
        }

        $line = $text->getLine($location);
        $replacement = $input['replacement']($line);

        $text->setLine($replacement, $location);
        $text->setCurrentLineNumber($location);
    }
712011
public function handle()
    {
        $content = $this->dbTransaction(function () {
            $this->content->fill($this->attributes);
            $this->handleThumb();

            if ($this->parentId === null) {
                $this->content->setAsRoot();
            }

            if ($this->parentId !== $this->content->parent_id) {

                if ($this->content->type->name === 'category') {
                    if (!empty($this->content->children()->first())) {
                        throw new InvalidArgumentException('Only parent for the category without children can be updated');
                    }
                };

                $parent = Content::find($this->parentId);
                if (!$parent) {
                    throw new InvalidArgumentException('Parent not found');
                }

                $this->content->setChildOf($parent);
            } else {
                $this->content->save();
            }

            event('content.updated', [$this->content]);
            return $this->content;
        });
        return $content;
    }
326481
protected function setPath($path)
    {
        if ($path !== '' && !$this->isValidPath($path)) {
            throw new \InvalidArgumentException("Invalid path '$path'");
        }
        
        $this->path = (string)$path;
    }
853942
public function validate($page, Constraint $constraint)
    {
        if (!$page instanceof CreateAction && !$page instanceof Page) {
            throw new \InvalidArgumentException(sprintf(
                '%s can only validate %s or %s objects; %s given.',
                self::class,
                Page::class,
                CreateAction::class,
                is_object($page) ? get_class($page) : gettype($page)
            ));
        }
        if ($actualPage = $this->pageLoader->retrieveByPath(
            $page instanceof CreateAction
                ? $page->getFullPath()
                : $page->getPath()
        )) {
            $this->context
                ->buildViolation($constraint->message)
                    ->atPath('path')
                    ->setParameter('{{ name }}', $actualPage->getName())
                    ->setParameter('{{ path }}', $actualPage->getPath())
                    ->setParameter('{{ parent }}', $actualPage->getParent()->getName())
                ->addViolation()
            ;
        }
    }
831052
public function addIndexMetadata($contextName, IndexMetadata $indexMetadata)
    {
        if (isset($this->indexMetadatas[$contextName])) {
            throw new \InvalidArgumentException(sprintf(
                'Context name "%s" has already been registered',
                $contextName
            ));
        }

        $indexMetadata->setName($this->name);
        $indexMetadata->setClassMetadata($this);
        $this->indexMetadatas[$contextName] = $indexMetadata;
    }
1124203
public function unserialize($serialized)
    {
        $serialized = @unserialize($serialized);
        if (!is_array($serialized)) {
            throw new \InvalidArgumentException(
                'Invalid argument 1, arguments must be serialized of array.',
                E_USER_ERROR
            );
        }

        $this->replace($serialized);
    }
1153100
public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
    {
        if ($this->solver->isSharedPackage($package)) {
            if (!$repo->hasPackage($package)) {
                throw new \InvalidArgumentException('Package is not installed : ' . $package->getPrettyName());
            }

            $this->symlinkInstaller->uninstall($repo, $package);
        } else {
            $this->defaultInstaller->uninstall($repo, $package);
        }
    }
784814
public function offsetSet($offset, $value)
    {
        if (!$value instanceof Author) {
            throw new InvalidArgumentType(
                '$value',
                'eZ\\Publish\\Core\\FieldType\\Author\\Author',
                $value
            );
        }

        $aAuthors = $this->getArrayCopy();
        parent::offsetSet($offset, $value);
        if (!isset($value->id) || $value->id == -1) {
            if (!empty($aAuthors)) {
                $value->id = end($aAuthors)->id + 1;
            } else {
                $value->id = 1;
            }
        }
    }
883113
public function offsetUnset($offset)
    {
        if(is_array($this->obj)){
            unset($this->obj[$offset]);
        }elseif(self::hasProperty($this->obj, $offset)){
            unset($this->obj->{$offset});
        }elseif(method_exists($this->obj, 'remove')){
            $this->obj->remove($offset);
        }elseif(method_exists($this->obj, $method = 'remove'.ucfirst($offset))){
            $this->obj->$method();
        }else{
            throw new \InvalidArgumentException("offsetUnset($offset) failed");
        }
    }
341104
public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target)
    {
        if (!$repo->hasPackage($initial)) {
            throw new \InvalidArgumentException('Package is not installed: '.$initial);
        }

        $this->logVerbose(sprintf('Updating Contao sources for %s', $initial->getName()));

        $contaoRoot = $this->getContaoRoot();

        $this->removeSymlinks($initial, $contaoRoot, $this->getSources($initial));

        parent::update($repo, $initial, $target);

        $this->addSymlinks($target, $contaoRoot, $this->getSources($target));
        $this->addCopies($target, $this->getFilesRoot(), $this->getUserFiles($target), self::DUPLICATE_IGNORE);
        $this->addRunonces($target, $this->getRunonces($target));

        $this->logVerbose('');
    }
1082303
public function setPublished($date)
    {
        if (!is_null($date) && !$date instanceof KDate) {
            throw new InvalidArgumentException('Invalid date type.');
        }

        $this->published = $date;
        return $this;
    }
650716
public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
    {
        if (!$repo->hasPackage($package)) {
            throw new \InvalidArgumentException('Package is not installed: '.$package);
        }

        $this->logVerbose(sprintf('Removing Contao sources for %s', $package->getName()));

        $this->removeSymlinks($package, $this->getContaoRoot(), $this->getSources($package));

        parent::uninstall($repo, $package);

        $this->logVerbose('');
    }
127124
public function set($key, $value)
    {
        if (!is_string($key)) {
            throw new \InvalidArgumentException('$key must be string');
        }

        if (!is_string($value) && !is_numeric($value) && !is_bool($value)) {
            throw new \InvalidArgumentException('$value must be string, int or bool');
        }

        $this->annotations[] = [
            'key' => $key,
            'value' => (string) $value
        ];
    }
303013
public function make($data)
    {
        if ($data instanceof Collection) {
            $this->data = collect($data->toArray());
        } elseif (is_array($data)) {
            $this->data = collect($data);
        } else {
            throw new InvalidArgumentException('Invalid data type.');
        }

        $this->config = Config::get('nestable');

        $this->parent = $this->config['parent'];

        $this->primary_key = $this->config['primary_key'];

        return $this;
    }