Class Inx_Api_IndexOutOfBoundsException

Description

An Inx_Api_IndexOutOfBoundsException is thrown when trying to access an invalid index of an indexed object.

An Inx_Api_IndexOutOfBoundsException is thrown when trying to access an invalid index of an indexed object. This applies mainly to the various RowSets and ResultSets used in the API. Example:

 $rset = Inx_Api_Mailing_MailingManager->selectAll();

 for($i = -1; $i <= rest->size(); $i++)
 {
 	   echo $rset->get($i)->getName();
 }
This code snippet contains two errors: The first index retrieved is -1 and the last index retrieved is rset->size(). -1 is no valid index as the first element of a ResultSet has the index 0. As the first valid index is 0, the last valid index is rset->size() - 1. Therefore, these errors will raise an Inx_Api_IndexOutOfBoundsException.

Located in /Api/IndexOutOfBoundsException.php (line 24)

Exception
   |
   --Inx_Api_IndexOutOfBoundsException
Variables

Inherited Variables

Inherited from Exception (Internal Class)

$code
$file
$line
$message
$previous
$string
$trace
Methods

Inherited Methods

Inherited From Exception (Internal Class)

constructor __construct ( [$message = ], [$code = ], [$previous = ] )
getCode ( )
getFile ( )
getLine ( )
getMessage ( )
getPrevious ( )
getTrace ( )
getTraceAsString ( )
__clone ( )
__toString ( )

Documentation generated on Thu, 17 Sep 2015 14:27:25 +0200 by phpDocumentor 1.3.2