<?php /*

 Composr
 Copyright (c) Christopher Graham, 2004-2024

 See docs/LICENSE.md for full licensing information.


 NOTE TO PROGRAMMERS:
   Do not edit this file. If you need to make changes, save your changed file to the appropriate *_custom folder
   **** If you ignore this advice, then your website upgrades (e.g. for bug fixes) will likely kill your changes ****

*/

/**
 * @license    http://opensource.org/licenses/cpal_1.0 Common Public Attribution License
 * @copyright  Christopher Graham
 * @package    core_cns
 */

/**
 * Hook class.
 * Points hooks should follow this naming convention according to points_ledger column names: t_type__t_subtype (or just t_type to match all t_subtypes). By defining a hook accordingly, you are indicating that all transactions matching the t_type (and t_subtype if applicable) are considered 'low-impact'. This means they will be hidden from ledger tables on members' point profiles and instead displayed as a cumulative tally (determined by the points_profile function) at the top of their points profile.
 */
class Hook_points_member__visit
{
    /**
     * Determine the aggregate row language for POINTS_PROFILE.tpl.
     *
     * @param  ?MEMBER $member_id_of The ID of the member who is being viewed (null: was run from the admin ledger)
     * @param  ?MEMBER $member_id_viewing The ID of the member who is doing the viewing (null: current member)
     * @return ?array List containing label for use with aggregate point tables (null: hook disabled)
     */
    public function points_profile(?int $member_id_of, ?int $member_id_viewing) : ?array
    {
        return [
            'label' => do_lang('COUNT_VISITS'),
        ];
    }
}
