Skip to content

Commit

Permalink
Rename SearchOr.php to SearchOrFilter.php and improve description
Browse files Browse the repository at this point in the history
  • Loading branch information
AngelFQC committed Jun 11, 2024
1 parent 1b5754c commit 1576694
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/CoreBundle/Entity/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use ApiPlatform\Metadata\GetCollection;
use ApiPlatform\Metadata\Post;
use ApiPlatform\Metadata\Put;
use Chamilo\CoreBundle\Filter\SearchOr;
use Chamilo\CoreBundle\Filter\SearchOrFilter;
use Chamilo\CoreBundle\Repository\MessageRepository;
use Chamilo\CoreBundle\State\MessageByGroupStateProvider;
use Chamilo\CoreBundle\State\MessageProcessor;
Expand Down Expand Up @@ -77,7 +77,7 @@
BooleanFilter::class,
properties: ['receivers.read']
)]
#[ApiFilter(SearchOr::class, properties: ['title', 'content'])]
#[ApiFilter(SearchOrFilter::class, properties: ['title', 'content'])]
class Message
{
public const MESSAGE_TYPE_INBOX = 1;
Expand Down
4 changes: 2 additions & 2 deletions src/CoreBundle/Entity/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use ApiPlatform\Metadata\Put;
use Chamilo\CoreBundle\Controller\Api\UserSkillsController;
use Chamilo\CoreBundle\Entity\Listener\UserListener;
use Chamilo\CoreBundle\Filter\SearchOr;
use Chamilo\CoreBundle\Filter\SearchOrFilter;
use Chamilo\CoreBundle\Repository\Node\UserRepository;
use Chamilo\CoreBundle\Traits\UserCreatorTrait;
use Chamilo\CourseBundle\Entity\CGroupRelTutor;
Expand Down Expand Up @@ -78,7 +78,7 @@
'lastname' => 'partial',
]
)]
#[ApiFilter(SearchOr::class, properties: ['username', 'firstname', 'lastname'])]
#[ApiFilter(SearchOrFilter::class, properties: ['username', 'firstname', 'lastname'])]
#[ApiFilter(filterClass: BooleanFilter::class, properties: ['isActive'])]
class User implements UserInterface, EquatableInterface, ResourceInterface, ResourceIllustrationInterface, PasswordAuthenticatedUserInterface, LegacyPasswordAuthenticatedUserInterface, ExtraFieldItemInterface, Stringable
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

declare(strict_types=1);

/* For licensing terms, see /license.txt */

declare(strict_types=1);

namespace Chamilo\CoreBundle\Filter;

use ApiPlatform\Doctrine\Orm\Filter\AbstractFilter;
Expand All @@ -12,7 +12,7 @@
use Doctrine\ORM\QueryBuilder;
use InvalidArgumentException;

class SearchOr extends AbstractFilter
class SearchOrFilter extends AbstractFilter
{
protected function filterProperty(
string $property,
Expand Down Expand Up @@ -59,7 +59,7 @@ public function getDescription(string $resourceClass): array
'property' => null,
'type' => 'string',
'required' => false,
'description' => 'Do a "Search OR" across multiple fields',
'description' => 'It does a "Search OR" using `LIKE %text%` to search for fields that contain `text`',
],
];
}
Expand Down

0 comments on commit 1576694

Please sign in to comment.