SproutCMS

This is the code documentation for the SproutCMS project

class Category

Extending this class

<?php
/**
* New class description goes here
* 
* @author Your Name, 2024-05-05
**/
class NewClassName extends Category {
    
    /**
    * Return an array of IDs of categories a record is in.
    * If there are no categories, returns an empty array.
    **/
    public function categoryList (string $table, int $record_id) {
        // Method code goes here
    }
    
    /**
    * Return an array of IDs of records in a given category.
    * If there are no records, returns an empty array.
    **/
    public function recordList (string $table, int $category_id) {
        // Method code goes here
    }
    
    /**
    * Does a given category contatin a given record?
    * Returns true if found, false otherwise
    **/
    public function contains (string $table, int $record_id, int $category_id) {
        // Method code goes here
    }
    
    /**
    * Removes a record from a category.
    * Returns true on success and false on failure
    **/
    public function removefrom (string $table, int $record_id, int $category_id) {
        // Method code goes here
    }
    
    /**
    * Creates a category.
    * Returns the id or NULL on failure.
    **/
    public function create (string $table, string $name) {
        // Method code goes here
    }
    
    /**
    * Looks up a category.
    * Returns the id, or NULL if not found.
    **/
    public function lookup (string $table, string $name, bool $case_sensitive) {
        // Method code goes here
    }
    
    /**
    * Inserts a record into a category.
    **/
    public function insertInto (string $table, int $record_id, int $category_id) {
        // Method code goes here
    }
    
    /**
    * Converts a category table (e.g. 'articles_cat_list') into a main table (e.g. 'articles')
    * Assumes standard naming conventions.
    **/
    public function tableCat2main (string $table) {
        // Method code goes here
    }
    
    /**
    * Converts a main table name into a joiner column name.
    * Assumes standard naming conventions.
    **/
    public function columnMain2joiner (string $table) {
        // Method code goes here
    }
    
    /**
    * Converts a main table name into a joiner table name.
    * Assumes standard naming conventions.
    **/
    public function tableMain2joiner (string $table) {
        // Method code goes here
    }
    
    /**
    * Converts a main table name into a category table name.
    * Assumes standard naming conventions.
    **/
    public function tableMain2cat (string $table) {
        // Method code goes here
    }
    
    /**
    * Get the name of a category based on the category id
    * Returns the name, or NULL if not found.
    **/
    public function name (string $table, string $id) {
        // Method code goes here
    }
    
    /**
    * Looks up a category. If not found, creates the category.
    * Returns the id or NULL on failure.
    **/
    public function lookupOrCreate (string $table, string $name, bool $case_sensitive) {
        // Method code goes here
    }
    
}
?>