|
From: Chris W. <ch...@cw...> - 2002-08-14 11:55:57
|
On Wed, 2002-08-14 at 06:39, Gert Thiel wrote:
> Sorry,
>
> but the SPOPS documentation is *very* incomplete.
Well, on this feature it is :-)
> 1) Multiple-Field ID Fields
>
> I declared as follows:
>
> 'articleprices' => {
> 'object_name' => 'articleprice',
> ...
> 'id_field' => [ 'ARTIKEL', 'LAND', 'WAEHRUNG' ],
This is correct.
> nevertheless this fails:
>
> $articlespecialprice = BaerShopSF::data::articlespecialprices->fetch( [$a,
> $country, $currency] );
Instead of being an arrayref, you specify the ID in a comma-separated
string:
$articlespecialprice = BaerShopSF::data::articlespecialprices->fetch(
"$a,$country,$currency" );
You can look at t/31_dbi_multifield.t for more examples. I'm adding
documentation to SPOPS::DBI right now.
> Why? Can you give some examples?
>
> 2) Relationships (has_a, links_to)
>
> How do has_a and links_to work?
> Can you give some examples?
For 'links_to', please see 'perldoc SPOPS::ClassFactory::DBI'.
For 'has_a'... wow, there's nothing there. My apologies.
There are working examples of relationships in the eg/ directory:
My::Doodad has_a My::User, My::User links_to My::Group, My::Group
links_to My::User.
I'll move the existing examples for 'links_to' and add new information
for 'has_a' to SPOPS::Manual::Relationships so they're in one place.
Thanks for bringing these up.
Chris
--
Chris Winters (ch...@cw...)
Building enterprise-capable snack solutions since 1988.
|