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

nextras / orm / 28897357009

07 Jul 2026 08:43PM UTC coverage: 92.123% (-0.04%) from 92.166%
28897357009

Pull #796

github

web-flow
Merge cb86ce19a into 556ac76b8
Pull Request #796: add Extension extensibility entry point

44 of 50 new or added lines in 8 files covered. (88.0%)

4339 of 4710 relevant lines covered (92.12%)

5.41 hits per line

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

80.0
/src/Extension.php
1
<?php declare(strict_types = 1);
2

3
namespace Nextras\Orm;
4

5

6
use Nextras\Orm\Bridges\NetteDI\OrmExtension;
7
use Nextras\Orm\Entity\Reflection\EntityMetadata;
8
use Nextras\Orm\Entity\Reflection\PropertyMetadata;
9
use Nextras\Orm\Mapper\IMapper;
10
use Nextras\Orm\Model\IModel;
11
use Nextras\Orm\Repository\IRepository;
12
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
13

14

15
/**
16
 * An entry point for various extensions for Orm.
17
 *
18
 * To implement the extension, override methods you want to utilize.
19
 * Registering a new configurator extension is done through {@see OrmExtension} for Nette DIC.
20
 */
21
abstract class Extension
22
{
23
        /**
24
         * Modifies the model instance.
25
         *
26
         * Runs once when the model is instantiated.
27
         */
28
        public function configureModel(
29
                IModel $model,
30
        ): void
31
        {
32
        }
6✔
33

34
        /**
35
         * Modifies the repository instance.
36
         *
37
         * Runs every time the mapper is instantiated in runtime.
38
         *
39
         * @param IRepository<*> $repository
40
         */
41
        public function configureRepository(
42
                IRepository $repository,
43
        ): void
44
        {
NEW
45
        }
×
46

47

48
        /**
49
         * Modifies the mapper instance.
50
         *
51
         * Runs every time the mapper is instantiated in runtime.
52
         *
53
         * @param IMapper<*> $mapper
54
         */
55
        public function configureMapper(
56
                IMapper $mapper,
57
        ): void
58
        {
59
        }
6✔
60

61

62
        /**
63
         * Modifies the entity metadata instance.
64
         *
65
         * Runs when entity property metadata are parsed during compile time (before cache serialization).
66
         */
67
        public function configureEntityMetadata(
68
                EntityMetadata $metadata,
69
        ): void
70
        {
71
        }
2✔
72

73

74
        /**
75
         * Modifies the entity property metadata instance.
76
         *
77
         * Runs when entity property metadata are parsed during compile time (before cache serialization).
78
         */
79
        public function configureEntityPropertyMetadata(
80
                EntityMetadata $entityMetadata,
81
                PropertyMetadata $propertyMetadata,
82
                TypeNode $propertyType,
83
        ): void
84
        {
85
        }
2✔
86
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc