I am using Symfony 1.0, and I have this MyClassInc.class.php
in my project/lib
folder
class MyClassInc {
public function validateFunction ($params) {
// my codes
}
static function testFunction ($params){
// my codes
}
}
Then, my action actions.class.php
in my project/apps/myapps/modules/actions
.
class inventoryCycleCountActions extends sfActions
{
public function validateOutstandingTransaction () {
$res0 = MyClassInc :: validateFunction($param); // It works
$res1 = MyClassInc :: testFunction($param); // It works
$myClass = new MyClassInc();
$res2 = $myClass->validateFunction($param); // still works
$res3 = $myClass->testFunction($param); // still works, da hell?
}
}
I tried to clear my cache folder to do re-test, but it seems that all of those work just fine.
Question: So.. WHY? and which one should I use? Does it have any effect with performance or anything?
Update 1:
class MyClassInc {
public function isProductValidated ($product){
return true;
}
public function validateFunction ($params) {
// IF, I call by using "$res0".. Throws error
//
$this->isProductInLoadPlans($product);
}
}
If I call validateFunction via $res0, it will throw this error:
sfException: Call to undefined method inventoryCycleCountActions::isProductValidated.
And, if I call it via $res2, it works just fine.
Since, I am currently using $res0 and so I have to call that method like this instead.
MyClassInc :: isProductValidated ($product)