Element_OphTrOperationnote_Cataract::afterConstruct PHP Method

afterConstruct() protected method

protected afterConstruct ( )
    protected function afterConstruct()
    {
        if ($this->isNewRecord && isset(Yii::app()->session['selected_firm_id'])) {
            $defaultLengthRecord = OphTrOperationnote_CataractIncisionLengthDefault::model()->findByAttributes(array('firm_id' => (int) Yii::app()->session['selected_firm_id']));
            if ($defaultLengthRecord) {
                $this->length = $defaultLengthRecord->value;
            } elseif (isset(Yii::app()->params['default_incision_length']) && Yii::app()->params['default_incision_length'] !== '') {
                $this->length = Yii::app()->params['default_incision_length'];
            }
        }
        parent::afterConstruct();
    }