Yes, currently in our object I read the column headers to get a list of the variables.
The only problem I run into is the following:
I should be able to create
$db->firstname
So I use the unknown tag, just like you do.
But this construct fails.
$db->('firstname')
And this IS Critical!
This it what killed us with Lasso 9 since this works fine using dynamic local variables, but I have not been able to make this work, and have essentially given up for now.
The issue for us is that we do not want to write
$db->field('firstname')
This just feels wrong (I am ready to be criticized)
The reason is that not all variables in our database object are related to fields in the database. For example, if "error" is a variable the you write
$db->error
Thanks for the discussion here, I appreciate going through the Knop approach. My initial feeling with knop->database was that it was a lightweight database object compares to some of the other frameworks out there. Please do not take this as a criticism.
On Jun 10, 2010, at 12:42 AM, Johan Solve wrote:
> (moving a discussion from Lasso Talk) > > On Wed, Jun 9, 2010 at 10:02 PM, Deco Rior (Tennissource) <decorior@tennissource.net> wrote: >> I was looking at the database module. is there anyway to create a database object that does not have a record stored in the database. > > I've thought a bit more about how to implement active record in knop_database and it's actually very easy, almost all of it is already there, it just needs some tweaks to make it easier to use. > > > It would work like this to create a new record > $db -> new; // clears the db object, exists already as ->reset > > $db -> firstname='Joe'; // can be done today as $db -> 'recorddata' -> insert('firstname'='Joe'); > // or > $db -> field('firstname'='Joe'); > // or > $db -> field('firstname')='Joe'; > // set more field values here > > $db -> saverecord; // can be done today as $db -> addrecord($recorddata_array) where $recorddataarray is ->recorddata converted from a map to an array > > > To modify an existing record it would be like this > $db -> getrecord($keyvalue); > $db -> firstname='Joe'; // can be done today, see above > $db -> saverecord; // can be done today as $db -> saverecord($recorddata_array) > > So as you see, it's not much to it. > > > -- > Johan Sölve [FSA Member, Lasso Partner] > Web Application/Lasso/FileMaker Developer > MONTANIA SOFTWARE & SOLUTIONS > http://www.montania.se mailto:joh-n@montania.se > (spam-safe email address, replace '-' with 'a') > > -- > ############################################################# > This message is sent to you because you are subscribed to > the mailing list <knop@lists.montania.se>. > To unsubscribe, E-mail to: <knop-off@lists.montania.se> > Send administrative queries to <knop-request@lists.montania.se> > List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html > Project homepage http://montania.se/projects/knop/ > Google Code has the latest downloads at http://code.google.com/p/knop/
-- ############################################################# This message is sent to you because you are subscribed to the mailing list <knop@lists.montania.se>. To unsubscribe, E-mail to: <knop-off@lists.montania.se> Send administrative queries to <knop-request@lists.montania.se> List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html Project homepage http://montania.se/projects/knop/ Google Code has the latest downloads at http://code.google.com/p/knop/
Jun 10
Johan Solve Active record
Jun 10, 2010; 08:42
Johan Solve
Active record
Jun 10
Deco Rior (Tennissource Re: Active record
Jun 10, 2010; 09:11
Deco Rior (Tennissource
Re: Active record
Jun 10
Deco Rior (Tennissource Re: Active record
Jun 10, 2010; 16:22
Deco Rior (Tennissource
Re: Active record
Jun 10
Deco Rior (Tennissource Re: Active record
Jun 10, 2010; 16:25
Deco Rior (Tennissource
Re: Active record
Jun 10
Johan Solve Re: Active record
Jun 10, 2010; 16:48
Johan Solve
Re: Active record
Jun 10
Johan Solve Re: Active record
Jun 10, 2010; 23:40
Johan Solve
Re: Active record
Jun 10
Johan Solve Re: Active record
Jun 10, 2010; 23:45
Johan Solve
Re: Active record
Jun 11
Göran Törnquist Re: Active record
Jun 11, 2010; 00:02
Göran Törnquist
Re: Active record
Jun 11
Deco Rior (Tennissource Re: Active record
Jun 11, 2010; 05:54
Deco Rior (Tennissource
Re: Active record
Jun 11
Göran Törnquist Re: Active record
Jun 11, 2010; 07:39
Göran Törnquist
Re: Active record
Jun 11
Göran Törnquist Re: Active record
Jun 11, 2010; 15:30
Göran Törnquist
Re: Active record
Oct 26
Deco Rior Re: Active record
Oct 26, 2010; 16:06
Deco Rior
Re: Active record
Search
Lasso Programming
This site manages and broadcasts several email lists pertaining to Lasso Programming and technologies related and used by Lasso developers. Sign up today!