protected function createIndex($model)
    {
        if ($this->identifierAsIndex) {
            return current($this->getIdentifierValues($model));
        }

        return parent::createIndex($model);
    }
protected function createIndex($model)
    {
        if ($this->identifierAsIndex) {
            return current($this->getIdentifierValues($model));
        }

        return parent::createIndex($model);
    }
protected function createIndex ( $ model ) { if ( $ this -> identifierAsIndex ) { return current ( $ this -> getIdentifierValues ( $ model ) ) ; } return parent :: createIndex ( $ model ) ; }
Creates a new unique index for this model.

If the model has a single-field identifier, this identifier is used.

Otherwise a new integer is generated.

@param mixed $model The choice to create an index for

@return int|string A unique index containing only ASCII letters,
digits and underscores.
Creates a new unique index for this model .