Completing the Business Tier Code
In the business tier, you??™ll add some new methods that will call the previously created stored
procedures in the data tier. Recall that you started working on the Catalog class (located in the
business/catalog.php file) in Chapter 4. The new methods that you??™ll add here follow:
??? GetDepartmentDetails()
??? GetCategoriesInDepartment()
??? GetCategoryDetails()
??? HowManyPages()
??? GetProductsInCategory()
??? GetProductsOnDepartment()
??? GetProductsOnCatalog()
??? GetProductDetails()
??? GetProductLocations()
Defining Product List Constants and Activating Session
Before writing the business tier methods, let??™s first update the include/config.php file by adding
the SHORT_PRODUCT_DESCRIPTION_LENGTH and PRODUCTS_PER_PAGE constants. These allow you to
easily define the product display of your site by specifying the length of product descriptions and
how many products to be displayed per page. These are the values the business tier methods will
supply when calling stored procedures that return pages of products, such as catalog_get_
products_on_catalog.
...
// Server HTTP port (can omit if the default 80 is used)
define('HTTP_SERVER_PORT', '80');
/* Name of the virtual directory the site runs in, for example:
'/tshirtshop/' if the site runs at http://www.example.com/tshirtshop/
'/' if the site runs at http://www.
Pages:
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237