for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace roaresearch\yii2\formgenerator\roa\models;
use roaresearch\yii2\roa\ResourceSearch;
use yii\data\ActiveDataProvider;
/**
* Contract to filter and sort collections of `Form` records.
*
* @author Angel (Faryshta) Guevara <[email protected]>
*/
class FormSearch extends Form implements ResourceSearch
{
* @inhertidoc
protected function slugBehaviorConfig(): array
return [
'idAttribute' => [],
'resourceName' => 'form',
];
}
public function rules()
[['created_by'], 'integer'],
[['name'], 'string'],
public function search(
array $params,
?string $formName = ''
): ?ActiveDataProvider {
$this->load($params, $formName);
if (!$this->validate()) {
return null;
$class = get_parent_class();
return new ActiveDataProvider([
'query' => $class::find()->andFilterWhere([
'created_by' => $this->created_by,
created_by
roaresearch\yii2\formgen...r\roa\models\FormSearch
__get
])
->andFilterWhere(['like', 'name', $this->name]),
]);