• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

heimrichhannot / contao-utils-bundle / 38530168142

14 Oct 2026 07:43AM UTC coverage: 83.881% (+4.1%) from 79.825%
38530168142

Pull #108

github

koertho
add createCondition method
Pull Request #108: add search vector field

360 of 373 new or added lines in 16 files covered. (96.51%)

1556 of 1855 relevant lines covered (83.88%)

8.58 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

75.0
/src/Event/BuildSearchVectorEvent.php
1
<?php
2

3
namespace HeimrichHannot\UtilsBundle\Event;
4

5
use Symfony\Contracts\EventDispatcher\Event;
6

7
/**
8
 * Dispatched before a search vector is tokenized and stored.
9
 *
10
 * Use it to add values that are not stored in a column of the record, for example tags or other relations kept in a
11
 * separate table, or to remove values that should not be searchable.
12
 */
13
class BuildSearchVectorEvent extends Event
14
{
15
    /**
16
     * @param array<string, mixed> $row    The raw database row
17
     * @param list<string>         $values The formatted, not yet tokenized values. Each value stays a separate
18
     *                                     section of the vector, so a quoted phrase never matches across two values.
19
     * @param string               $locale The language of the record. The values have been resolved in this language,
20
     *                                     and the values of the vector are normalized and stemmed in it as well.
21
     */
22
    public function __construct(
23
        public readonly string $table,
24
        public readonly array $row,
25
        private array $values,
26
        public readonly string $locale,
27
    ) {}
15 ✔
28

29
    /**
30
     * @return list<string>
31
     */
32
    public function getValues(): array
33
    {
34
        return $this->values;
15 ✔
35
    }
36

37
    /**
38
     * @param list<string> $values
39
     */
40
    public function setValues(array $values): void
41
    {
NEW
42
        $this->values = \array_values($values);
×
43
    }
44

45
    public function addValue(string $value): void
46
    {
47
        $this->values[] = $value;
1 ✔
48
    }
49
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc