Class yii\sphinx\gii\model\Generator

Inheritanceyii\sphinx\gii\model\Generator » yii\gii\Generator
Available since version2.0
Source Code https://github.com/yiisoft/yii2-sphinx/blob/master/gii/model/Generator.php

This generator will generate one or multiple ActiveRecord classes for the specified Sphinx index.

Property Details

$baseClass public property
public $baseClass 'yii\sphinx\ActiveRecord'
$db public property
public $db 'sphinx'
$indexName public property
public $indexName null
$modelClass public property
public $modelClass null
$ns public property
public $ns 'app\models'
$useIndexPrefix public property
public $useIndexPrefix false

Method Details

attributeLabels() public method

public void attributeLabels ( )
autoCompleteData() public method

public void autoCompleteData ( )
generate() public method

public void generate ( )
generateClassName() protected method

Generates a class name from the specified table name.

protected string generateClassName ( $indexName )
$indexName string

The table name (which may contain schema prefix)

return string

The generated class name

generateIndexName() public method

Generates the table name by considering table prefix.

If $useIndexPrefix is false, the table name will be returned without change.

public string generateIndexName ( $indexName )
$indexName string

The table name (which may contain schema prefix)

return string

The generated table name

generateLabels() public method

Generates the attribute labels for the specified table.

public array generateLabels ( $table )
$table \yii\db\TableSchema

The table schema

return array

The generated attribute labels (name => label)

generateRules() public method

Generates validation rules for the specified index.

public array generateRules ( $index )
$index yii\sphinx\IndexSchema

The index schema

return array

The generated validation rules

getDbConnection() protected method

protected yii\sphinx\Connection getDbConnection ( )
return yii\sphinx\Connection

The Sphinx connection as specified by $db.

getDescription() public method

public void getDescription ( )
getIndexNames() protected method

protected array getIndexNames ( )
return array

The index names that match the pattern specified by $indexName.

getName() public method

public void getName ( )
hints() public method

public void hints ( )
requiredTemplates() public method

public void requiredTemplates ( )
rules() public method

public void rules ( )
stickyAttributes() public method

public void stickyAttributes ( )
validateDb() public method

Validates the $db attribute.

public void validateDb ( )
validateIndexName() public method

Validates the $indexName attribute.

public void validateIndexName ( )
validateModelClass() public method

Validates the $modelClass attribute.

public void validateModelClass ( )
validateNamespace() public method

Validates the $ns attribute.

public void validateNamespace ( )