Property | Type | Description | |
---|---|---|---|
$modelClass | the model class name. This property must be set. The model class must implement [[ActiveRecordInterface]]. | ||
$searchModelClass | class name of the model which should be used as search model. This can be a PHP callback of following signature: php function (\yii\web\Controller $controller) { return new \yii\base\Model; } If not set it will be composed using [[modelClass]]. If yii2tech/ar-search extension is installed - [[\yii2tech\ar\search\ActiveSearchModel]] instance will be used as a search model. |
Method | Description | |
---|---|---|
findModel ( string $id ) : yii\db\ActiveRecordInterface | |
Returns the data model based on the primary key given. | |
newModel ( ) : yii\db\ActiveRecordInterface | |
Creates new model instance. | |
newSearchModel ( ) : |
Creates new search model instance. |
public findModel ( string $id ) : yii\db\ActiveRecordInterface | |
||
$id | string | the ID of the model to be loaded. If the model has a composite primary key, the ID must be a string of the primary key values separated by commas. The order of the primary key values should follow that returned by the `primaryKey()` method of the model. |
return | yii\db\ActiveRecordInterface | |
the model found |
public newModel ( ) : yii\db\ActiveRecordInterface | |
||
return | yii\db\ActiveRecordInterface | |
new model instance. |
public newSearchModel ( ) : |
||
return | new search model instance. |
public $modelClass |
public $searchModelClass |