Collections functions
General functions
Render functions
Theme permission 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 3469 to 3502

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)
    );

    
$log sql_limit_with_total_count($log_query,$fetchrows,0,false,NULL);

    return 
$log;
    }

This article was last updated 5th October 2022 04:05 Europe/London time based on the source file dated 4th October 2022 09:50 Europe/London time.