Solar_Sql_Model_Collection::getRecordOffset()

public mixed Solar_Sql_Model_Collection::getRecordOffset ( Solar_Sql_Model_Record $record )

Given a record object, looks up its offset value in the collection.

Parameters

  • (Solar_Sql_Model_Record) $record: The record to find in the collection.

Returns

  • (mixed) The record offset (which may be zero), or boolean false if the same record was not found in the collection.

Description

Given a record object, looks up its offset value in the collection.

For this to work, the record primary key must exist in the collection, and the record looked up in the collection must have the same primary key and be of the same class.

Note that the returned offset may be zero, indicating the first element in the collection. As such, you should check the return for boolean false to indicate failure.



Local