I am working with the Phalcon ODM and can't find a solution for following problem: There are many fields. I am always working with a different set of fields. Not every field is stored by default. I need a solution to work with getters and settern for manipulating a result. For example:
class Categories extends Collection {
public $count;
public $name;
public $slug;
public $parent_id;
public $active;
// Is this possible???
// This would render "0" if the $count is empty
public function getCount() {
if(empty($this->count()) { $this->count = 0; }
}
}
Thank you!