I am using Symfony 1.0 and I have this MyClassInc.class.phpin my folderproject/lib
class MyClassInc {
public function validateFunction ($params) {
}
static function testFunction ($params){
}
}
Then my action is actions.class.phpin mine project/apps/myapps/modules/actions.
class inventoryCycleCountActions extends sfActions
{
public function validateOutstandingTransaction () {
$res0 = MyClassInc :: validateFunction($param);
$res1 = MyClassInc :: testFunction($param);
$myClass = new MyClassInc();
$res2 = $myClass->validateFunction($param);
$res3 = $myClass->testFunction($param);
}
}
I tried to clear the cache folder in order to re-check, but it seems that they all work fine.
Question:
So ... WHY? and which should i use? Does this have any effect on performance or something else?
Update 1:
class MyClassInc {
public function isProductValidated ($product){
return true;
}
public function validateFunction ($params) {
$this->isProductInLoadPlans($product);
}
}
If I call validateFunction using $ res0 , it will raise this error:
sfException: method call undefinedinventoryCycleCountActions :: isProductValidated.
And , if I call it through $ res2 , it works fine.
$res0, .
MyClassInc:: isProductValidated ($ product)