cphalcon: [BUG]: Model::find() protected/private property access public
Using get-set and protected property
class Model extends \Phalcon\Mvc\Model
{
protected $prop;
public function getProp()
{
return $this->prop;
}
public function setProp($prop)
{
$this->prop = $prop;
return $this;
}
}
$model = new Model();
**_Protected, Can't access._**
echo $model->prop;
$model->prop = 1;
**_Work can access_**
$model->setProp() OR $model->getProp();
$resultset = Model::find();
foreach ( $resultset as $row ) {
echo $row->prop; //Works
$row->prop = 1;
}
Config Phalcon 4.0.2 / PHP 7.4.2 / Postgresql 12.1/Nginx 1.16.1
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 15 (15 by maintainers)
Related ~https://github.com/phalcon/zephir/pull/2056~, https://github.com/phalcon/zephir/pull/2078, https://github.com/phalcon/zephir/issues/2057
Will write some extra tests for this to see if we can reproduce this. Are you on Linux?
Yes exactly . works on both way $model->prop or $model->setProp()
Like this?
@tidytrax thnx. We will have a look at it
@tidytrax Is this occurring with properties as private as well?