ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilMailAutoCompleteRecipientResult Class Reference

Class ilMailAutoCompleteRecipientResult. More...

+ Collaboration diagram for ilMailAutoCompleteRecipientResult:

Public Member Functions

 isResultAddable ()
 addResult ($login, $firstname, $lastname)
 getItems ()
 numItems ()

Data Fields

const MODE_STOP_ON_MAX_ENTRIES = 1
const MODE_FETCH_ALL = 2
const MAX_RESULT_ENTRIES = 1000
 $result = array()

Protected Member Functions

 initMode ($mode)

Protected Attributes

 $allow_smtp = null
 $user_id = null
 $handled_recipients = array()
 $mode = self::MODE_STOP_ON_MAX_ENTRIES
 $max_entries = null

Detailed Description

Member Function Documentation

ilMailAutoCompleteRecipientResult::addResult (   $login,
  $firstname,
  $lastname 
)
Parameters
string$login
string$firstname
string$lastname

Definition at line 84 of file class.ilMailAutoCompleteRecipientResult.php.

{
if(!isset($this->handled_recipients[$login]))
{
$recipient = array();
$recipient['value'] = $login;
$label = $login;
if($firstname && $lastname)
{
$label .= " [" . $firstname . ", " . $lastname . "]";
}
$recipient['label'] = $label;
$this->result['items'][] = $recipient;
$this->handled_recipients[$login] = 1;
}
}
ilMailAutoCompleteRecipientResult::getItems ( )
Returns
array

Definition at line 106 of file class.ilMailAutoCompleteRecipientResult.php.

References $result.

{
return $this->result;
}
ilMailAutoCompleteRecipientResult::initMode (   $mode)
protected
Parameters
int$mode
Exceptions
InvalidArgumentException

Definition at line 48 of file class.ilMailAutoCompleteRecipientResult.php.

References $mode.

{
if(!in_array($mode, array(self::MODE_FETCH_ALL, self::MODE_STOP_ON_MAX_ENTRIES)))
{
throw new InvalidArgumentException("Wrong mode passed!");
}
$this->mode = $mode;
}
ilMailAutoCompleteRecipientResult::isResultAddable ( )
Returns
bool

Definition at line 60 of file class.ilMailAutoCompleteRecipientResult.php.

{
if(
$this->mode == self::MODE_STOP_ON_MAX_ENTRIES &&
$this->max_entries >= 0 && count($this->result['items']) >= $this->max_entries
)
{
return false;
}
else if(
$this->mode == self::MODE_FETCH_ALL &&
count($this->result['items']) >= self::MAX_RESULT_ENTRIES
)
{
return false;
}
return true;
}
ilMailAutoCompleteRecipientResult::numItems ( )
Returns
int

Definition at line 114 of file class.ilMailAutoCompleteRecipientResult.php.

{
return (int)count($this->result['items']);
}

Field Documentation

ilMailAutoCompleteRecipientResult::$allow_smtp = null
protected

Definition at line 16 of file class.ilMailAutoCompleteRecipientResult.php.

ilMailAutoCompleteRecipientResult::$handled_recipients = array()
protected

Definition at line 18 of file class.ilMailAutoCompleteRecipientResult.php.

ilMailAutoCompleteRecipientResult::$max_entries = null
protected

Definition at line 20 of file class.ilMailAutoCompleteRecipientResult.php.

ilMailAutoCompleteRecipientResult::$mode = self::MODE_STOP_ON_MAX_ENTRIES
protected

Definition at line 19 of file class.ilMailAutoCompleteRecipientResult.php.

Referenced by initMode().

ilMailAutoCompleteRecipientResult::$result = array()

Definition at line 21 of file class.ilMailAutoCompleteRecipientResult.php.

Referenced by getItems().

ilMailAutoCompleteRecipientResult::$user_id = null
protected

Definition at line 17 of file class.ilMailAutoCompleteRecipientResult.php.

const ilMailAutoCompleteRecipientResult::MAX_RESULT_ENTRIES = 1000

Definition at line 14 of file class.ilMailAutoCompleteRecipientResult.php.

const ilMailAutoCompleteRecipientResult::MODE_FETCH_ALL = 2

Definition at line 12 of file class.ilMailAutoCompleteRecipientResult.php.

const ilMailAutoCompleteRecipientResult::MODE_STOP_ON_MAX_ENTRIES = 1

Definition at line 11 of file class.ilMailAutoCompleteRecipientResult.php.


The documentation for this class was generated from the following file: