| Total Lines | 19 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | public static function registerType(ModelBuilder $modelBuilder): void |
||
| 21 | { |
||
| 22 | $typeBuilder = $modelBuilder->defineType( |
||
| 23 | FriendRelationshipDefinition::class, |
||
| 24 | TestModelConstants::TYPE_NAME_FRIEND_RELATIONSHIP_DEFINITION |
||
| 25 | ) |
||
| 26 | ->namespaceUri(TestModelConstants::MODEL_NAMESPACE) |
||
| 27 | ->extendsType(RelationshipDefinition::class) |
||
|
|
|||
| 28 | ->instanceProvider( |
||
| 29 | new class implements ModelTypeInstanceProviderInterface |
||
| 30 | { |
||
| 31 | public function newInstance(ModelTypeInstanceContext $instanceContext): FriendRelationshipDefinition |
||
| 32 | { |
||
| 33 | return new FriendRelationshipDefinition($instanceContext); |
||
| 34 | } |
||
| 35 | } |
||
| 36 | ); |
||
| 37 | |||
| 38 | $typeBuilder->build(); |
||
| 39 | } |
||
| 41 |