Web Marketing Tool
Chris B.


An object for adding, viewing, editing and deleting a specific document.
Filename: /admin/tools/WMT\SQL.php
Database Table: documents
Extends: Result
      Extends: AbstractDatabase

Document PHP Methods

add($postVals) v4.23

Adds a new record. The $postVals is an array of the values for each column when adding the record. Returns 0 if fails, returns the id of the new record if success.

addDocument($dTitle, $dContent, $user) v4.3

add new document ($dTitle is document title, $dContent is document content, $user is member ID)

allowedRead($user) v4.3

Give a user a permission to read

allowedSave($user) v4.3

Give a user the permission to save the document

convertHTML($htmlContent = '') v4.23

Converts ~~ variables in the $htmlContent that is provided and returns the converted content. The title of the ~~ variables are converted by the content from the column in the database with the matching title.

deleteThis($restoreQuery = '') v4.23

Deletes the loaded record from the database. |
$restoreQuery = FOR INTERNAL USE. FOR TYPICAL USAGE LEAVE THIS BLANK. The restore query to pass along when deleting an object with dependencies.

duplicateThis($newValues = null) v4.92

Creates a duplicate record in the database of the current object and returns the id of the new record.

getAdded() v4.3

Document added date

getAuthor($authorTitle = "Owner: ") v4.3

Returns Author Title, first name and last name

getCategory v4.3

Returns document category title

getCategory() v4.92

getConfidential() v4.3

Returns whether the document is confidential or not

getContent() v4.3

getDefaultTRHTML() v4.23

Returns the default html code for a tr row with all of the fields from the database in it as ~~ vars

getID() v4.3

Returns document id

getLocked() v4.3

Returns whether the document is locked or not

getOrder() v4.3

Returns document order

getOwner() v4.3

Returns document owner

getSkillLevel() v4.3

returns member skill level

getSubCategory() v4.3

Returns document sub-category

getSubCatTitle() v4.3

getTitle() v4.3

Returns document title

getUpdated() v4.3

Returns when the document last updated

getUType() v4.3

returns document type

getValue($fieldName) v4.23

Returns the value from a specific column for this record. |
$fieldName = The name of the column to get the value from.

hideAllFields() v4.23

Hides all of the columns (fields) from the database table from being returned in the results.

hideField($fieldTitle) v4.23

Hides a specific column (field) from the database table from being returned in the results.

loadDocument($dID, $user) v4.3

Load a document where $dID is document id

loadDocumentLight($docID, $docUType, $docTitle, $docAdded, $docUpdated, $docSCat, $docSkillLevel, $docOwner, $docOwnerType) v4.3

loadDocumentLight($docID, $docUType, $docTitle, $docAdded, $docUpdated, $docSCat, $docSkillLevel, $docOwner, $docOwnerType)

loadValues($id) v4.23

Loads values for the record with the id specified. Returns 0 if not found, 1 if success

loadValuesWhere($whereString = 'id=1') v4.23

Loads values for the record matching the criteria specified by $whereString. If the there is more than one record returned from the query then only the first record is loaded. Returns 0 if not found, 1 if success. |
$whereString = The condition to use to filter the results. Should be mysql format.

save($postVals) v4.23

Saves the record with the new values specified in the $postVals array. |
$postVals = An array containing the values to be stored. The key of the array is used for the column name and the value of the array is the value to be stored in that column.

saveChanges($user) v4.3

setAttachID($attachID) v4.3

setAttachType($attachType) v4.3

setConfidential($confidential) v4.3

Set whether the document should be confidential or not

setContent($dContent) v4.3

Set document content

setLocked($locked) v4.3

set whether the document will be locked or not

setOrder($dOrder) v4.3

set the order of a doc

setOwner($owner) v4.3

Set document owner

setOwnerType($ownerType) v4.3

Set document owner type

setSkillLevel($skilllevel) v4.3

set skill level of adocument

setSubCategory($sCategory) v4.3

Change subcategory of a doc

setTitle($dTitle) v4.3

Set document title

setUType($uType) v4.3

showAllFields() v4.23

Shows all the columns (fields) from the database table in the results that are returned.

showField($fieldTitle) v4.23

Shows a specific column (field) from the database table in the results that are returned.

Columns in the documents Database Table:

id    title    body    added    updated    icon    documentfolder    dorder    locked    confidential    member    attachid    attachtype    redirect    shortdescr    

Code Example

Use the code below to view a record in an html page:

Use the code below to add a record:

Use the code below to delete a record:

webmarketingtool.com Webutation DMCA.com Protection Status Authorize.net GoDaddy
Valid HTML! Valid CSS!

Reseller: Chris Brevig
(502) 225-3237