Sorry, here is example:
class someController extends ControllerBase
{
public function initialize()
{
$user = Users::findFirstById($id);
$this->user = $user;
// do something on $user
$user->someRelations; //etc
}
public function editAction()
{
$this->user->someOtherRelations; //etc
}
}
I need allways do some operations on Users and related tables in initialize()
, and other operations on Users and related tables in some Actions.
Is it better way/performance than (creating $user) $user = Users::findFirstById($id);
in editAction()
(omitting DRY)??