_title = $title; $this->_editor = $editor; $this->_price = $price; } // end constructor // methods defined here public function getProductType() { // prevent non listed product type. could be grabbed within a database $typeTest = array('Book', 'Blue Ray', 'DVD', 'Magazine'); if (in_array($this->_type, $typeTest)) { return $this->_type; } else { return $this->_errMsg = 'not a current product into the list'; } } public function getProductTitle() { if (is_string($this->_title) && strlen($this->_title) > 0) { return $this->_title; } else { return $this->_errMsg = '-no title available-'; } } public function getProductPrice() { return $this->_price; } public function getProductEditor() { if (is_string($this->_editor) && !empty($this->_editor)) { return $this->_editor; } else { return $this->_errMsg = '-no editor available-'; } } // end methods } // end class. no PHP end tag here to prevent crashing display _author = $author; $this->_pageCount = $pageCount; } // end constructor // get function to display protected property public function getBookPageCount() { return $this->_pageCount; } // end PageCount // end methods } // end class. no PHP end tag here to prevent crashing display _type = $type; $this->_author = $author; $this->_duration = $duration; } // end constructor // get function to display protected property public function getMediaDuration() { return $this->_duration; } // end PageCount } // end class. no PHP end tag here to prevent crashing display
$product2 is a ' . $product2->getProductType() . ' called “' . $product2->getProductTitle() . '” by ' . $product2->getProductAuthor() . ', ' . $product1->getProductEditor() . ' (' . $product2->getMediaDuration() . ' minutes). Price: $' . $product2->getProductPrice() . '
' . "\n"; // include ending template. no PHP end tag here to prevent crashing display. Doh! Must works fine if I had'nt forget anything... require_once('view/html_end.inc.php');