1. In Yii 2.0, the following error occurs: “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:
PHP
<?php
namespace api\modules\v1\models;
class PlanTask extends \api\models\PlanTask
{
/**
* {@inheritdoc}
* @return PlanTaskQuery the active query used by this AR class.
*/
public static function find()
{
return new PlanTaskQuery(get_called_class());
}
}
3. View the \common\logics\PlanTask.php file. The method claimProcess is defined as private, so it can only be accessed within the class where it is defined. The code is as follows:
PHP
private function claimProcess(PlanTask $planTask, PlanTaskStep $planTaskStep)
{
}4. Now the method claimProcess needs to be accessed by its subclass’s subclass. Define it as protected, so that it can be accessed by the class itself, its subclasses, and its parent class. The code is as follows:
PHP
protected function claimProcess(PlanTask $planTask, PlanTaskStep $planTaskStep)
{
}5. The error has been resolved, as shown in Figure 2.

