On Wed, 2005-07-27 at 11:08 -0700, Bill Shupp wrote: > dopry wrote: > > Bill, > > > > I'm not sure if this fits on your long term roadmap, but a little code > > reorg to make an API for VegaDNS would be nice. Something to make it > > easier to add new interfaces to the database like XML-RPC, SOAP or maybe > > even a libvegadns for c. > > Sure, I'm open to suggestions. If you check out 1.1.4, you'll see I'm > moving all permissions related stuff into the permissions class, which > is a step in that direction. > > Regards, > > Bill >
So maybe we just need a domain class a record class to start, or do you think I should lean toward a functional approach? //bad pseudo code to follow class domain { function domain($domainname == false) { if (is_numeric($domainname)) load SOA data / perms return self elseif($domainname) deserialize domain data return self else load defaults return self } } //getters/setters //@ return array of records function getRecords() //addRecord to domains // @params record object/array of record objects function addRecord($record) { } function save { if (domainid == newdomain) insert else update } } }