Chapter 8: Intranet Simple Document (Best web hosting site) Publisher 259 Following

Chapter 8: Intranet Simple Document Publisher 259 Following are the response class methods: . Response(): This is the constructor method that creates the response object. This method does the following: Sets the object variable cat_tbl, which holds the category table name, to $LD_CATEGORY_TBL, which is loaded from the ld.conf file. Sets the object variable doc_tbl, which holds the document table name, to $LD_DOC_TBL, which is loaded from the ld.conf file. Sets the object variable resp_tbl, which holds the response table name, to $LD_RESPONSE_TBL, which is loaded from the ld.conf file. Sets the object variable dbi to point to the class.DBI.php-provided object, which is passed to the constructor by an application. The dbi member variable holds the DBI object that is used to communicate with the back-end database. Calls setResponseID() to set the response ID of the object. Sets the object variable std_fields, which is an array that contains the LD_RESPONSE table attributes and their data type. . loadResponseInfo(): This method loads all attribute values into the response object from the LD_RESPONSE table by the specified response ID. This is how it works: It calls setResponseID() to set the passed response ID to the current object. If no response ID is passed, the current object s response ID is taken. The $this->dbi object is used to retrieve all the attribute values of the given response from the LD_RESPONSE table. Each of the values is set to the current object so that they can be retrieved at any time using the other get methods of this class. For example $this->RESPONDER is set the username who responded (i.e. provided feedback) to a document. . getResponsesByDocID(): This method returns all responses for a given document ID. This is how it works: It executes a SQL query that retrieves all the attributes of the LD_RESPONSE table for a given document ID. It stores the result of the query in an array unless the result set is empty. The method returns null when there is no result found from the query; otherwise, it returns the array.

Leave a Reply