View Single Post
  #2 (permalink)  
Old January 10th, 2010, 01:59 PM
AaronSaray AaronSaray is offline
Wrox Author
Points: 118, Level: 2
Points: 118, Level: 2 Points: 118, Level: 2 Points: 118, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2009
Location: Milwaukee, WI
Posts: 15
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Hey - great catch. The example should be the following code:

PHP Code:
class productBuilder
{
    protected 
$_product NULL;
    protected 
$_configs = array();

    public function 
__construct($configs)
    {
        
$this->_product = new product();
        
$this->_configs $configs;
    }

    public function 
build()
    {
        
$this->_product->setSize($this->_configs['size']);
        
$this->_product->setType($this->_configs['type']);
        
$this->_product->setColor($this->_configs['color']);
    }

    public function 
getProduct()
    {
        return 
$this->_product;
    }

Sorry for any confusion. Thanks so much!
__________________
-aaron
--
aaronsaray.com || <-- yeah... try it.
Reply With Quote