protected function constructDerived($bean, $setDefaults) { assert('$bean === null || $bean instanceof RedBean_OODBBean'); assert('is_bool($setDefaults)'); parent::constructDerived($bean, $setDefaults); if ($bean === null) { $this->permissions = Permission::NONE; } }
protected function constructDerived($bean, $setDefaults) { assert('$bean === null || $bean instanceof RedBean_OODBBean'); assert('is_bool($setDefaults)'); parent::constructDerived($bean, $setDefaults); if ($bean === null && $setDefaults) { $currentUser = Yii::app()->user->userModel; if (!$currentUser instanceof User) { throw new NoCurrentUserSecurityException(); } $this->currency = Yii::app()->currencyHelper->getActiveCurrencyForCurrentUser(); } }