DatabaseResult.solveResultIndex ( databaseColumn,
BaseDatabaseWrapper wrapperInstance,
array $  callBack 
)

Solver for result index value with call-back method.

Parameters:
$databaseColumn Database column where the index might be found
$wrapperInstance The wrapper instance to ask for array element $callBack Call-back object for setting the index; 0=object instance,1=method name
Returns:
void 4 *
Todo:
Find a caching way without modifying the result array

Implements SearchableResult.

Definition at line 385 of file class_DatabaseResult.php.

References find(), and getFoundValue().

00385                                                                                                                   {
00386                 // By default nothing is found
00387                 $indexValue = 0;
00388 
00389                 // Is the element in result itself found?
00390                 if ($this->find($databaseColumn)) {
00391                         // Use this value
00392                         $indexValue = $this->getFoundValue();
00393                 } elseif ($this->find($wrapperInstance->getIndexKey())) {
00394                         // Use this value
00395                         $indexValue = $this->getFoundValue();
00396                 }
00397 
00398                 // Set the index
00399                 call_user_func_array($callBack, array($indexValue));
00400         }

Here is the call graph for this function:


Generated on Mon Dec 8 01:11:12 2008 for Ship-Simulator by  doxygen 1.5.6