/**
* Strategy for mapping array offsets to primary key values.
*/
class DATA_MySQL5_PrimaryKeyIndexingStrategy implements DATA_AssociativeIndexingStrategy {
/**
* Stores table name on construction for future operations.
* @var string
*/
protected $table;
/**
* Constructor.
*
* @param string $table The table name.
*/
public function __construct($table) {
$this->table = $table;
}
public function isSingleRowIndexing() {
return true;
}
protected function getIndexField() {
$keys = DATA_MySQL5_Schema::getPrimaryKey($this->table);
return $keys[0];
}