<commit_before><?php
/* vim: set expandtab shiftwidth=4 softtabstop=4 tabstop=4 foldmethod=marker: */

/**
 * TIP_Expirable definition file
 *
 * LICENSE: This source file is subject to the New BSD license that is 
 * available through the world-wide-web at the following URI:
 * http://www.opensource.org/licenses/bsd-license.php
 * If you did not receive a copy of the New BSD License and are unable to
 * obtain it through the web, please send a note to license@php.net so we
 * can mail you a copy immediately.
 *
 * @author    <NAME> <<EMAIL>>
 * @copyright Copyright &copy; 2006-2008 <NAME>
 * @license   http://www.opensource.org/licenses/bsd-license.php New BSD License
 * @package   TIP
 * @since     0.3.4
 */

/**
 * Expirable module
 *
 * @package TIP
 */
class TIP_Expirable extends TIP_Content
{
    //{{{ Properties

    /**
     * The field with the boolean public flag
     * @var string
     */
    protected $public_field = '_public';

    /**
     * The field owning the expiration time
     * @var string
     */
    protected $expiration_field = '_expiration';

    /**
     * The default expiration time
     * @var string
     */
    protected $expiration = '+2 month';

    //}}}
    //{{{ Construction/destruction

    static protected function checkOptions(&$options)
    {
        if (!parent::checkOptions($options)) {
            return false;
        }

        isset($options['browsable_fields']) || $options['browsable_fields'] = array(
            TIP_PRIVILEGE_NONE    => array('group'),
            TIP_PRIVILEGE_TRUSTED => array('_user'),
            TIP_PRIVILEGE_ADMIN   => array('_check', '_public', '__ALL__')
        );
        return true;
    }

    /**
     * Constructor
     *
     * Initializes a TIP_Expirable instance.
     *
     * @param array $options Properties values
     */
    protected function __construct($options)
    {
        parent::__construct($options);
    }

    //}}}
    //{{{ Callbacks

    /**
     * 'on_row' callback for TIP_Data_View
     *
     * Adds the following calculated fields to every data row:
     * - 'EXPIRED': true if the row has expired
     *
     * @param  array &$row The row as generated by TIP_Data_View
     * @return bool        always true<commit_msg>[TIP_Expiration] Renamed TIP_Expirable to TIP_Expiration<commit_after><?php
/* vim: set expandtab shiftwidth=4 softtabstop=4 tabstop=4 foldmethod=marker: */

/**
 * TIP_Expiration definition file
 *
 * LICENSE: This source file is subject to the New BSD license that is 
 * available through the world-wide-web at the following URI:
 * http://www.opensource.org/licenses/bsd-license.php
 * If you did not receive a copy of the New BSD License and are unable to
 * obtain it through the web, please send a note to license@php.net so we
 * can mail you a copy immediately.
 *
 * @author    <NAME> <<EMAIL>>
 * @copyright Copyright &copy; 2006-2008 <NAME>
 * @license   http://www.opensource.org/licenses/bsd-license.php New BSD License
 * @package   TIP
 * @since     0.3.4
 */

/**
 * Expiration module
 *
 * @package TIP
 */
class TIP_Expiration extends TIP_Content
{
    //{{{ Properties

    /**
     * The field with the boolean public flag
     * @var string
     */
    protected $public_field = '_public';

    /**
     * The field owning the expiration time
     * @var string
     */
    protected $expiration_field = '_expiration';

    /**
     * The default expiration time
     * @var string
     */
    protected $expiration = '+2 month';

    //}}}
    //{{{ Construction/destruction

    static protected function checkOptions(&$options)
    {
        if (!parent::checkOptions($options)) {
            return false;
        }

        isset($options['browsable_fields']) || $options['browsable_fields'] = array(
            TIP_PRIVILEGE_NONE    => array('group'),
            TIP_PRIVILEGE_TRUSTED => array('_user'),
            TIP_PRIVILEGE_ADMIN   => array('_check', '_public', '__ALL__')
        );
        return true;
    }

    /**
     * Constructor
     *
     * Initializes a TIP_Expiration instance.
     *
     * @param array $options Properties values
     */
    protected function __construct($options)
    {
        parent::__construct($options);
    }

    //}}}
    //{{{ Callbacks

    /**
     * 'on_row' callback for TIP_Data_View
     *
     * Adds the following calculated fields to every data row:
     * - 'EXPIRED': true if the row has expired
     *
     * @param  array &$row The row as generated by TIP_Data_View
     * @return bool        always true
{'fraction_non_alphanumeric': 0.11524081812183858, 'fraction_numerical': 0.006597756762700682, 'mean_word_length': 2.4533029612756265, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4103348', 'n_tokens_mistral': 1376, 'n_tokens_neox': 1335, 'n_words': 397}