common/models/entities/Template.php
public function beforeSave( $insert ) {

		if( parent::beforeSave( $insert ) ) {

			if( $this->themeId <= 0 ) {

				$this->themeId = null;
			}

			return true;
		}

		return false;
	}
public function beforeSave( $insert ) {

		if( parent::beforeSave( $insert ) ) {

			if( $this->themeId <= 0 ) {

				$this->themeId = null;
			}

			return true;
		}

		return false;
	}
public function beforeSave ( $ insert ) { if ( parent :: beforeSave ( $ insert ) ) { if ( $ this -> themeId <= 0 ) { $ this -> themeId = null ; } return true ; } return false ; }
yii\db\BaseActiveRecord
yii \ db \ BaseActiveRecord