Re: [CDBI] How do I add a method to a loaded class?

[prev] [thread] [next] [Date index for 2005/08/07]

From: John Beppu
Subject: Re: [CDBI] How do I add a method to a loaded class?
Date: 04:13 on 07 Aug 2005
--===============1494619312==
Content-Type: multipart/alternative; 
	boundary="----=_Part_2188_8250420.1123387999094"

------=_Part_2188_8250420.1123387999094
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

On 8/6/05, Alex Aminoff <alex@xxxxxxxxx.xxx> wrote:
>=20
>  Very basic newbie question...
>  I have loaded up my database into a Class::DBI structure using=20
> Class::DBI::Loader. Now I would like to add a method to one of the=20
> autogenerated classes that will calculate some stuff based on various dat=
a,=20
> but otherwise appear in most respects like any other column from the DB. =
I'm=20
> pretty sure I want something using MyTable->columns( TEMP =3D> calcfield =
).
>=20


Let's step back a bit. Why do you need to have the calcfield() method appea=
r=20
as a column? Isn't it enough that you managed to put the method into the=20
MyTable namespace and are able to call it?

------=_Part_2188_8250420.1123387999094
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

On 8/6/05, <b class=3D"gmail_sendername">Alex Aminoff</b> &lt;<a href=3D"ma=
ilto:alex@xxxxxxxxx.xxx">alex@xxxxxxxxx.xxx</a>&gt; wrote:<div><span class=
=3D"gmail_quote"></span><blockquote class=3D"gmail_quote" style=3D"border-l=
eft: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left:=
 1ex;">







<div><font face=3D"Arial" size=3D"2"></font>&nbsp;</div>
<div><font face=3D"Arial" size=3D"2">Very basic newbie question...</font></=
div>
<div><font face=3D"Arial" size=3D"2"></font>&nbsp;</div>
<div><font face=3D"Arial" size=3D"2">I have loaded up my database into a Cl=
ass::DBI=20
structure using Class::DBI::Loader. Now I would like to add a method to one=
 of=20
the autogenerated classes that will calculate some stuff based on various d=
ata,=20
but otherwise appear in most respects like any other column from the DB. I'=
m=20
pretty sure I want something using MyTable-&gt;columns( TEMP =3D&gt; calcfi=
eld=20
).</font></div>
</blockquote></div><br>
<br>
Let's step back a bit.&nbsp; Why do you need to have the calcfield() method
appear as a column?&nbsp; Isn't it enough that you managed to put the metho=
d
into the MyTable namespace and are able to call it?&nbsp; <br>

------=_Part_2188_8250420.1123387999094--


--===============1494619312==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

--===============1494619312==--

(message missing)

[CDBI] How do I add a method to a loaded class?
Alex Aminoff 00:22 on 07 Aug 2005

Re: [CDBI] How do I add a method to a loaded class?
John Beppu 04:13 on 07 Aug 2005

Generated at 09:40 on 09 Aug 2005 by mariachi v0.52