Answer the question
In order to leave comments, you need to log in
What am I doing wrong with the dependency container?
This is how I set it in the bootstrap file
class DependencySetUp implements BootstrapInterface
{
public function bootstrap($app)
{
$container = \Yii::$container;
$container->setSingleton(FieldConfig::class,[],[
CompanyFieldService::getCompanyField(),
CompanyFieldService::getCompanyFieldPK()
]);
}
}
public function getCompanyFields()
{
return $this->hasMany(
$this->сompanyField,
['field_config_id' => $this->companyFieldPK]
);
}
public static function getCompanyField()
{
return CompanyField::class;
}
public static function getCompanyFieldPK()
{
return current(CompanyField::primaryKey());
}
Getting unknown property: common\modules\Main\Entities\FieldConfig::companyField
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question