Hi, my database table for example "names": id int, name varchar, active int
I have something like this in model, yesterday or before yesterday it worked
class Names extends \Phalcon\Mvc\Model
{
public function afterFetch()
{
if($this->id == 5)
{
$this->alert = "ALERT"; //alert isn't field in database
}
}
}
class IndexController extends \Phalcon\Mvc\Controller
{
public function indexAction()
{
$names = Names::find()->toArrray();
print_r($names);
}
}
i got:
Array
(
[id] => 4
[name] => Android
[active] => 1
)
Array
(
[id] => 5
[name] => Android
[active] => 1
)
I need to get
Array
(
[id] => 4
[name] => Android
[active] => 1
)
Array
(
[id] => 5
[name] => Android
[active] => 1
[alert] => Alert // <----- HERE is what i need to exist
)
only when i add field "alert" to database i can overwrite its value :(
Can you restore previous version?