I have 3 models, Where
Basemodel
Model_A
Model_B
In Basemodel i have initialize function setting a property value
In Model_A i don't have initialize function, if i return anything from model
it will be successful
In Model_B i have initialize function, if i return anything from this model
its not returning anything. No Error, Nothing, Just Blank.
Base Models With initialize()
class Basemodel extends \Phalcon\Mvc\Model {
protected $name;
function initialize() {
$this->name = 'MyApplication';
}
}
Model A Without initialize():
class Model_a extends Basemodel {
function test() {
return $this->name; // WORKING
}
}
Model B With initialize():
class Model_b extends Basemodel {
public $b;
function initialize() {
$this->b = 'someName';
}
function rawtext() {
return $this->name; // NOT WORKING
}
}
If remove initialize() from Model_B, Then its returning the value successfully