public function onBeforeInsert() { parent::onBeforeInsert(); $this->castValues(); $this->user_id = md5(rand(0, 1000000.0) . microtime(true)); $this->password = UserService::makePassword($this->password); }