2025/10/08: Difference between revisions

From Woozle Writes Code
Jump to navigation Jump to search
No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 9: Line 9:
* To investigate: what does {{l/ver/fx|p=ferreteria|v=v0.6|FromItemPiece}}(ItemIface $oItem, PieceIface $oPiece) do? Tentative answer:
* To investigate: what does {{l/ver/fx|p=ferreteria|v=v0.6|FromItemPiece}}(ItemIface $oItem, PieceIface $oPiece) do? Tentative answer:
** If <code>$oPiece</code> has a value, parses it with <code>{{l/ver/fx|p=ferreteria|v=v0.6|ParseInputArgs}}($oPiece->GetExtras())</code>; otherwise, fetches a default. Either way, the value ends up in <code>$sVal</code>.
** If <code>$oPiece</code> has a value, parses it with <code>{{l/ver/fx|p=ferreteria|v=v0.6|ParseInputArgs}}($oPiece->GetExtras())</code>; otherwise, fetches a default. Either way, the value ends up in <code>$sVal</code>.
** Calls <code>{{l/ver/fx|p=ferreteria|v=v0.6|WithItemValue}}($oItem,$sVal)</code>.
** Calls <code>{{l/ver/fx|p=ferreteria|v=v0.6|WithItemValue}}($oItem,$sVal)</code>, which does:
*** {{fmt/php/inline|$this->Item($oItem);}}
*** {{fmt/php/inline|$this->}}<code>{{l/ver/fx|p=ferreteria|v=v0.6|ParseInputString}}</code>{{fmt/php/inline|($sValue);}}
=={{fmt/date|2025|10|27}}==
I think since the 8th I did a bunch of refactoring which now makes the solution obvious (it's probably what I had in mind when I did the refactoring): EngDbExport just needs to use the ToSchema iface/trait. This now works.

Latest revision as of 14:21, 27 October 2025

Codeblog

Recovered

EngDbExport is calling Schema::FromParams(), which isn't defined in cSchema's clade family; trying to figure out what the correct call is.

  • The function is defined in ToSchema, which is not a parent of Schema.
  • It's expecting to initialize an object with a Go() function. The cSchema class does in fact have that method, and appears to be what we want, so the question is how to create or access the object.
  • Apparently a cSchema object is normally created using InputRq::FromItemPiece().
  • That, however, is for use when we're still parsing the input; this is a different context. We just want to pass it some already-known parameters.
  • Therefore: we probably need to make a new alt-constructor.
  • To investigate: what does FromItemPiece(ItemIface $oItem, PieceIface $oPiece) do? Tentative answer:
    • If $oPiece has a value, parses it with ParseInputArgs($oPiece->GetExtras()); otherwise, fetches a default. Either way, the value ends up in $sVal.
    • Calls WithItemValue($oItem,$sVal), which does:

2025-10-27

I think since the 8th I did a bunch of refactoring which now makes the solution obvious (it's probably what I had in mind when I did the refactoring): EngDbExport just needs to use the ToSchema iface/trait. This now works.