yii\elasticsearch\ActiveRecord::getOldPrimaryKey PHP Method

getOldPrimaryKey() public method

public getOldPrimaryKey ( $asArray = false )
    public function getOldPrimaryKey($asArray = false)
    {
        $pk = static::primaryKey()[0];
        if ($this->getIsNewRecord()) {
            $id = null;
        } elseif ($pk == '_id') {
            $id = $this->_id;
        } else {
            $id = $this->getOldAttribute($pk);
        }
        if ($asArray) {
            return [$pk => $id];
        } else {
            return $id;
        }
    }