Posted: Sat Apr 22, 2006 1:21 pm
Ree wrote:Unfortunately we don't have McGruff here.
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Ree wrote:Unfortunately we don't have McGruff here.
n00b Saibot wrote:This needs elaboration...arborint wrote:You also might want to try composition rather than creating objects internally.
Code: Select all
class User
{
// Variables...
var $_UserID;
var $_Area;
var $_DB;
// Functions...
function User($UserID = '', $Area = '', $db)
{
$this->_DB = $db;
if (is_int($UserID))
$this->setUserID($UserID);
if($Area != '')
$this->_Area = $Area;
}
...
}
$user = new User($userid, $area, new DB($dsn));Here's the first one...Jcart wrote:Ree wrote:Unfortunately we don't have McGruff here.
That does have a bit there, only dullified by his own self. OK drop this off-topic rant right now!!!Ree wrote:Here's the first one...Jcart wrote:Ree wrote:Unfortunately we don't have McGruff here.
Jcart, we all know the story and we all know it didn't improve McGruff's reputation, but you do have to give him credit for many helpfull posts in the OOP/unit testing department. Many did find his input very useful, myself included. And that's exactly what I had in mind when posting.
So you don't have to roll your eyes.