suppose I’m injecting an active record object to another class (a controller in my case).
class Foo
{
public $bar;
public function __construct(ActiveRecord $bar)
{
$this->bar = $bar;
}
public function xyz(){
$this->bar->find(); // find is static and should not be called like this, right?
}
}
what is the best way to call static methods on the injected object? namely find() method. is there a best practice that I can follow?