关于类的参数问题
class CompanyController extends ApiController {
public function __construct(CompanyInterface $companyInterface)
{
$this->companyInterface = $companyInterface;
}
想请教下这里的CompanyInterface是以常量的形式做为参数存在的么?
$companyInterface是以变量的形式做为参数存在的么?
public function index()
{
$companies = $this->companyInterface->getCompanies();
//这里是将对象本身的属性做为一个对象去调用getCompanies()方法?
//还是将companyInterface的方法值做为对象的属性存储?
最后赋值给$companies
return $this->response->collection($companies, new CompanyTransformer);
response和collection是PHP系统属性和方法么?我这里更不明白了
}
}
请大牛指导,非常感谢