MCPcopy Create free account
hub / github.com/PHPantom-dev/phpantom_lsp / demo

Method demo

examples/demo.php:3136–3147  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3134class MixinGenericDemo
3135{
3136 public function demo(): void
3137 {
3138 $line = new ScaffoldingOrderLine();
3139
3140 // @mixin Builder<TRelatedModel> on Relation resolves TModel → Product
3141 // through: BelongsTo @extends Relation<Product> → @mixin Builder<TRelatedModel>
3142 // → TRelatedModel=Product → Builder<Product> → firstOrFail(): TModel=Product
3143 $line->product()->firstOrFail()->getPrice();
3144
3145 // Same resolution through find()
3146 $line->product()->find()->getSku();
3147 }
3148}
3149
3150

Callers

nothing calls this directly

Calls 5

getPriceMethod · 0.80
firstOrFailMethod · 0.80
productMethod · 0.80
getSkuMethod · 0.80
findMethod · 0.45

Tested by

no test coverage detected