We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Understanding the documentation

Don't know if I understood rightly one moment: "If you’re using PHP 5.4 is recommended declare each column that makes part of the model in order to save memory and reduce the memory allocation." ("Working with Models" article)

Does it means to declare php-variables, which has the same names as columns in datatable?

<?php

class Robots extends Phalcon\Mvc\Model
{

    public $id;

    public $name;

    public $type;

    public $year;

    public function getSource()
    {
        return "robots";
    }

}

A phrase "declare column" is slightly confusing =)



98.9k

Hi Eavu, yes, that exactly means define each property as a column rather than let PHP define them dynamically