jpfuentes2 / php-activerecord

ActiveRecord implementation for PHP
http://www.phpactiverecord.org/
Other
1.32k stars 443 forks source link

Void methods should return self #250

Open Addvilz opened 11 years ago

Addvilz commented 11 years ago

All void methods, like Model->set_attributes, should return instance of self ($this) instead of void thus making instance method call possible (PHP 5.4).

Sample use:

$mod[] = (new SomeModel())->set_attributes($attr);

$mod[] should then link to instance of SomeModel not become void.

This issue also affects method chaining.

Addvilz commented 5 years ago

For the record, I still think this is a good idea.