Class

Event

Package: PHPBoost\Event Copyright: © 2005-2019 PHPBoost License: GNU/GPL-3.0 Author: Benoit SAUTEL ben.popeye@phpboost.com Version: PHPBoost 5.2 - last update: 2016 10 24 Since: PHPBoost 2.0 - 2008 07 21 Contributor: Arnaud GENET elenwii@phpboost.com Located at: phpboost/event/Event.class.php

It's the common part between two types of event existing now in PHPBoost:

  • User contribution managed into the contribution panel
  • Administrator alert, triggered for example when a new update is available or when a new member account is to approbate
Direct known subclasses
AdministratorAlert, Contribution, Notification
Methods summary
public
# __construct( )

Builds an Event object.

public
# set_id( integer $id )

Sets the id of the event. The id is the corresponding data base entry one.

public
# set_entitled( string $entitled )

Sets the entitled of the event. The entitled can be considered as the name, it must be explicit.

public
# set_fixing_url( string $fixing_url )

Sets the URL corresponding to the event. For the contributions and the administrator alerts it's the number URL at which the problem can be solved.

public
# set_status( integer $new_current_status )

Set the status of the event.

public
# set_creation_date( Date $date )

Sets the creation date of the event.

public
# set_id_in_module( integer $id )

Sets the id in module parameter. It corresponds to the id of the element corresponding to the event in your data base tables. For example, il you use the events to allow user to purpose some news in your web site, it will be the id of the news added.

public
# set_identifier( string $identifier )

Sets the event identifier. To retrieve your event, you might need to have a field in which you put some informations, for example a hash or an identifier. It's that identifier which can be used to filter the events. You don't have to use it, you can let it blank.

public
# set_type( string $type )

Sets the type of the event. To retrieve your event, you might need to have a type of event, for example if your module has differents kinds of events. With this field, you can specify it.

public
# set_must_regenerate_cache( boolean $must )

Sets a private property indicating if the changes made on this event imply the regeneration of the events cache.

public integer
# get_id( )

Gets the id of the event (in the event data base).

public string
# get_entitled( )

Returns the entitled of the event.

public string
# get_fixing_url( )

Returns the URL corresponding to the alert.

public integer
# get_status( )

Gets the status of the event. The status is one of those elements: ul>

  • Event::EVENT_STATUS_UNREAD if it's not read.
  • Event::EVENT_STATUS_BEING_PROCESSED if the event is beeing processed
  • Event::EVENT_STATUS_PROCESSED if the event is processed.

  • public Date
    # get_creation_date( )

    Returns the creation date of the event.

    public integer
    # get_id_in_module( )

    Gets the id in the module. This value corresponds to the id of the daba base entry associated to the event.

    public string
    # get_identifier( )

    Gets the identifier of the event. To retrieve your event, you might need to have a field in which you put some informations, for example a hash or an identifier. It's that identifier which can be used to filter the events.

    public string
    # get_type( )

    Gets the type of the event. To retrieve your event, you might need to have a type of event, for example if your module has differents kinds of events. With this field, you can specify it.

    public boolean
    # get_must_regenerate_cache( )

    Gets the value indicating if the cache must be generated.

    public The
    # get_status_name( )

    Gets the event status name. It's automatically translated in the user language.

    public
    # build_event( integer $id, string $entitled, string $fixing_url, integer $current_status, Date $creation_date, integer $id_in_module, string $identifier, string $type )

    Builds an event object from its whole parameters.

    Constants summary
    integer EVENT_STATUS_UNREAD
    # 0
    integer EVENT_STATUS_BEING_PROCESSED
    # 1
    integer EVENT_STATUS_PROCESSED
    # 2
    Properties summary
    protected integer $id
    # 0
    protected string $entitled
    # ''
    protected string $fixing_url
    # ''
    protected integer $current_status
    # self::EVENT_STATUS_UNREAD
    protected $creation_date
    #
    protected integer $id_in_module
    # 0
    protected string $identifier
    # ''
    protected string $type
    # ''
    protected boolean $must_regenerate_cache
    # true