yii\elasticsearch\ActiveRecord::attributes PHP Method

attributes() public method

This method must be overridden by child classes to define available attributes. Attributes are names of fields of the corresponding elasticsearch document. The primaryKey for elasticsearch documents is the _id field by default which is not part of the attributes. You may define path mapping for the _id field so that it is part of the _source fields and thus becomes part of the attributes.
public attributes ( ) : string[]
return string[] list of attribute names.
    public function attributes()
    {
        throw new InvalidConfigException('The attributes() method of elasticsearch ActiveRecord has to be implemented by child classes.');
    }