Documentation

IMP_Flags
in package
implements ArrayAccess, Serializable

Provides an interface to deal with display of flags/keywords/labels on messages.

Tags
author

Michael Slusarz slusarz@horde.org

category

Horde

copyright

2009-2017 Horde LLC

license

http://www.horde.org/licenses/gpl GPL

Table of Contents

Interfaces

ArrayAccess
Serializable

Properties

$changed  : bool
Has the object data changed?
$_flaghook  : bool
Does the msglist_flags hook exist?
$_flags  : array<string|int, mixed>
The list of internal flags.
$_userflags  : array<string|int, mixed>
The list of user flags.

Methods

__construct()  : mixed
Constructor.
__serialize()  : array<string|int, mixed>
__unserialize()  : void
addFlag()  : string
Add a user-defined IMAP flag.
changed()  : array<string|int, mixed>
Returns a list of flags that have changed due to IMAP flag changes.
getList()  : array<string|int, mixed>
Return the raw list of flags.
offsetExists()  : bool
offsetGet()  : mixed
offsetSet()  : void
offsetUnset()  : void
parse()  : array<string|int, mixed>
Parse a list of flag information.
serialize()  : mixed
unserialize()  : mixed
updateFlag()  : mixed
Updates flag properties.
_save()  : mixed
Save the flag list to the prefs backend.

Properties

$changed

Has the object data changed?

public bool $changed = \false

$_flaghook

Does the msglist_flags hook exist?

protected bool $_flaghook = \true

$_flags

The list of internal flags.

protected array<string|int, mixed> $_flags = array()

$_userflags

The list of user flags.

protected array<string|int, mixed> $_userflags = array()

Methods

__construct()

Constructor.

public __construct() : mixed

__serialize()

public __serialize() : array<string|int, mixed>
Return values
array<string|int, mixed>

__unserialize()

public __unserialize(array<string|int, mixed> $data) : void
Parameters
$data : array<string|int, mixed>

addFlag()

Add a user-defined IMAP flag.

public addFlag(string $label) : string
Parameters
$label : string

The label to use for the new flag.

Tags
throws
IMP_Exception
Return values
string

The IMAP flag name.

changed()

Returns a list of flags that have changed due to IMAP flag changes.

public changed(array<string|int, mixed> $flags, bool $add) : array<string|int, mixed>
Parameters
$flags : array<string|int, mixed>

The list of IMAP flags added/removed.

$add : bool

True if these flags were added, false if they were removed.

Return values
array<string|int, mixed>

Array with two keys: 'add' and 'remove'. Each key contains a list of IMP_Flag_Base objects.

getList()

Return the raw list of flags.

public getList([array<string|int, mixed> $opts = array() ]) : array<string|int, mixed>
Parameters
$opts : array<string|int, mixed> = array()

Additional options:

  • imap: (boolean) If true, only return IMAP flags that can be set by the user. DEFAULT: false
  • mailbox: (string) A real (not virtual) IMAP mailbox. If set, will determine what flags are available in the mailbox. DEFAULT: '' (no mailbox check)
Return values
array<string|int, mixed>

An array of IMP_Flag_Base elements.

offsetExists()

public offsetExists(mixed $offset) : bool
Parameters
$offset : mixed
Return values
bool

offsetGet()

public offsetGet(mixed $offset) : mixed
Parameters
$offset : mixed

offsetSet()

public offsetSet(mixed $offset, mixed $value) : void
Parameters
$offset : mixed
$value : mixed
Tags
throws
InvalidArgumentException

offsetUnset()

public offsetUnset(mixed $offset) : void
Parameters
$offset : mixed

parse()

Parse a list of flag information.

public parse([array<string|int, mixed> $opts = array() ]) : array<string|int, mixed>
Parameters
$opts : array<string|int, mixed> = array()

Options:

  • flags: (array) IMAP flag info. A lowercase list of flags returned by the IMAP server.
  • headers: (Horde_Mime_Headers) Determines message information from a headers object.
  • runhook: (array) Run the msglist_flags hook? If yes, input is return from IMP_Mailbox_List#getMailboxArray().
  • personal: (mixed) Personal message info. Either a list of To addresses (Horde_Mail_Rfc822_List object) or the identity that matched the address list.
  • structure: TODO
Return values
array<string|int, mixed>

A list of IMP_Flag_Base objects.

serialize()

public serialize() : mixed

unserialize()

public unserialize(mixed $data) : mixed
Parameters
$data : mixed

updateFlag()

Updates flag properties.

public updateFlag(string $key, string $type, string $data) : mixed
Parameters
$key : string

The flag key.

$type : string

The property to update. Either 'bgcolor' or 'label'.

$data : string

The updated data.

_save()

Save the flag list to the prefs backend.

protected _save() : mixed

        
On this page

Search results