Collections functions
General functions
Node functions
Render functions
Theme permission functions
User functions
Resource functions

get_collection_log()

Description

Return the log for $collection

Parameters

ColumnTypeDefaultDescription
$collection integer
$fetchrows integer -1 How many rows to fetch

Return

array

Location

include/collections_functions.php lines 3599 to 3630

Definition

 
function get_collection_log($collection$fetchrows = -1)
    {
    
debug_function_call("get_collection_log"func_get_args());

    global 
$view_title_field;

    
$extra_fields hook("collection_log_extra_fields");
    if(!
$extra_fields)
        {
        
$extra_fields "";
        }

    
$log_query = new PreparedStatementQuery(
        
"SELECT c.ref,
                        c.date,
                        u.username,
                        u.fullname,
                        c.type,
                        r.field
{$view_title_field} AS title,
                        c.resource,
                        c.notes
                        
{$extra_fields}
                   FROM collection_log AS c
        LEFT OUTER JOIN user AS u ON u.ref = c.user
        LEFT OUTER JOIN resource AS r ON r.ref = c.resource
                  WHERE collection = ?
               ORDER BY c.ref DESC"
,
        array(
"i",$collection)
    );

    return 
sql_limit_with_total_count($log_query$fetchrows0falsenull);
    }

This article was last updated 19th March 2024 06:35 Europe/London time based on the source file dated 15th March 2024 17:00 Europe/London time.