[prev in list] [next in list] [prev in thread] [next in thread]
List: seagull-general
Subject: Re: [Seagull-general] DA Classes and DB_DataObject:?
From: AJ Tarachanowicz <aj () seagullproject ! org>
Date: 2006-06-21 15:16:44
Message-ID: 1150903004.8974.9.camel () localhost ! localdomain
[Download RAW message or body]
Hi Michael,
On Tue, 2006-06-20 at 14:09 -0700, Michael K Alber wrote:
> Can / Should DA classes use DB_DataObject instead of $queue =
> "SELECT ..."? Maybe something like below (I think I've got this right)
>
Yes, you could use DB_DataObject. I personally am against using DB_DO in
DAs mainly because it adds another dependency and lengthens execution
time. If you're into RAD than it will dramatically speed up development.
It's a fine line on when you should & shouldn't use it. However, there
is nothing preventing you from doing so in your module's DA. I also
would advise against instantiating $doUserPermissions in the constructor
specifically because not all methods are going to require a DO instance
for the DB tables user_permission, role_permission, usr, etc. I would
place the call directly in your method for example.
function getPermsByUserId($userId = 0)
{
SGL::logMessage(null, PEAR_LOG_DEBUG);
$oUserPerm = DB_DataObject::factory(...);
$oUserPerm->whereAdd('user_id', $userId);
$oUserPerm->find(true);
return $oUserPerm;
}
Best Regards,
--
AJ Tarachanowicz II
Core Developer
Seagull Framework
Coming to a webserver near you - http://www.seagullproject.org
_______________________________________________
Seagull-general mailing list
Seagull-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/seagull-general
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic