for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace roaresearch\yii2\workflow\roa\models;
use roaresearch\yii2\roa\ResourceSearch;
use yii\data\ActiveDataProvider;
/**
* Contract to filter and sort collections of `Workflow` records.
*
* @author Angel (Faryshta) Guevara <[email protected]>
*/
class WorkflowSearch extends Workflow implements ResourceSearch
{
* @inhertidoc
public function rules()
return [
[['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\workflo...a\models\WorkflowSearch
__get
])
->andFilterWhere(['like', 'name', $this->name]),
]);