In Yii 2.0, the error is reported: “Calling unknown method: API\modules\v1\models\plantask::claimProcess()”
1. In Yii 2.0, an error is reported: “Calling unknown method: API\modules\v1\models\plantask::claimProcess()”, as shown in Figure 1
2. View the \API\modules\v1\models\plantask.php file, the code is as follows
3. To view the \common\logics\plantask.php file, the method ClaimProcess is defined as private (private), and it can only be accessed by the class where it is defined. The code is as follows
private function claimProcess(PlanTask $planTask, PlanTaskStep $planTaskStep)
{
}
4. Now the method ClaimProcess needs to be accessed by the subclass of its subclass, which is defined as protected (protected), it can be accessed by itself and its subclass and parent class. The code is as follows
protected function claimProcess(PlanTask $planTask, PlanTaskStep $planTaskStep)
{
}
5. The error has been solved, as shown in Figure 2

