Skip to content

IBX-10458: Implemented new Content Type search PHP API #633

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 15 commits into
base: 4.6
Choose a base branch
from

Conversation

barw4
Copy link
Contributor

@barw4 barw4 commented Aug 12, 2025

🎫 Issue IBX-10458

Description:

The ContentTypeService contract has been extended with two new methods:

    public function findContentTypes(?ContentTypeQuery $query = null, array $prioritizedLanguages = []): SearchResult;
    public function countContentTypes(?ContentTypeQuery $query = null): int;

The ContentTypeQuery object receives the following arguments:

        ?CriterionInterface $criterion = null,
        array $sortClauses = [],
        int $offset = 0,
        int $limit = 25

And the available criterions are:

  • ContainsFieldDefinitionIds (joins field definitions and validates if a content type contains them)
  • ContentTypeGroupIds (joins content type group assignment table and searches for provided group ids)
  • Identifiers (content type identifiers)
  • Ids (content type ids)
  • IsSystem (joins content type group table via content type group assignment table and validates if group is system or not)
  • LogicalAnd
  • LogicalOr
  • LogicalNot

There are also available the following sort clauses:

  • Ibexa\Contracts\Core\Repository\Values\ContentType\Query\SortClause\Id
  • Ibexa\Contracts\Core\Repository\Values\ContentType\Query\SortClause\Identifiers

For QA:

Documentation:

@barw4 barw4 self-assigned this Aug 12, 2025
@barw4 barw4 added the Feature New feature request label Aug 12, 2025
@barw4 barw4 force-pushed the ibx-10458-content-type-search-papi branch from 701a49c to 5c19221 Compare August 12, 2025 08:06
@barw4 barw4 marked this pull request as ready for review August 13, 2025 08:30
@barw4 barw4 requested a review from a team August 13, 2025 08:31
@ezrobot ezrobot requested review from adamwojs, mikadamczyk, Steveb-p, alongosz, ciastektk, ViniTou, wiewiurdp, konradoboza and tbialcz and removed request for a team August 13, 2025 08:31
Copy link
Member

@adamwojs adamwojs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's focus first on establishing final shape of the contracts.

@barw4 barw4 force-pushed the ibx-10458-content-type-search-papi branch from b3df6c4 to 0859ce5 Compare August 20, 2025 11:59
@barw4 barw4 requested a review from adamwojs August 20, 2025 12:52
Comment on lines +21 to +26
* @param TCriterion $criterion
*/
public function supports(CriterionInterface $criterion): bool;

/**
* @param TCriterion $criterion
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PHPStan types need to be prefixed with @phpstan-param instead of @param. Otherwise, most likely, it will crash phpDocumentor.

Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature request Ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants