public function init() { if (!is_string($this->profileClass) && $this->profileClass !== false) { if (class_exists(__NAMESPACE__ . '\\Profile')) { $this->profileClass = __NAMESPACE__ . '\\Profile'; } else { $this->profileClass = Profile::className(); } } parent::init(); }
/** * Create blame. * @param BaseUserModel $user who will own this blame. * @param array $config blame class configuration array. * @return {$this->multiBlamesClass} */ public static function createBlame($user, $config = []) { if (!$user instanceof BaseUserModel) { $message = 'the type of user instance must be the extended class of BaseUserModel.'; throw new InvalidParamException($message); } $mbClass = static::buildNoInitModel(); $mbi = $mbClass->multiBlamesClass; return $user->create($mbi::className(), $config); }
/** * Friendly to IDE. * @return \vistart\Models\queries\BaseUserQuery */ public static function find() { return parent::find(); }