當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ActiveRecord::classname方法代碼示例

本文整理匯總了PHP中yii\db\ActiveRecord::classname方法的典型用法代碼示例。如果您正苦於以下問題:PHP ActiveRecord::classname方法的具體用法?PHP ActiveRecord::classname怎麽用?PHP ActiveRecord::classname使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在yii\db\ActiveRecord的用法示例。


在下文中一共展示了ActiveRecord::classname方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: bootstrap

 public function bootstrap($app)
 {
     Event::on(ActiveRecord::classname(), AppActiveRecord::EVENT_AFTER_TRANCINSERT, function ($event) {
         TcEventAction::EventActionAfterTrancInsert($event);
     });
     Event::on(ActiveRecord::classname(), AppActiveRecord::EVENT_AFTER_TRANCUPDATE, function ($event) {
         TcEventAction::EventActionAfterTrancUpdate($event);
     });
     Event::on(ActiveRecord::classname(), BaseActiveRecord::EVENT_AFTER_INSERT, function ($event) {
         TcEventAction::EventActionCreate($event);
     });
     Event::on(ActiveRecord::classname(), BaseActiveRecord::EVENT_AFTER_UPDATE, function ($event) {
         TcEventAction::EventActionUpdate($event);
     });
     Event::on(ActiveRecord::classname(), AppActiveRecord::EVENT_BEFORE_PUBLISH, function ($event) {
         TcEventAction::EventActionBeforePublish($event);
     });
     Event::on(ActiveRecord::classname(), AppActiveRecord::EVENT_AFTER_PUBLISH, function ($event) {
         TcEventAction::EventActionAfterPublish($event);
     });
     Event::on(AppActiveRecord::classname(), AppActiveRecord::EVENT_AFTER_SOFTDELETE, function ($event) {
         TcEventAction::EventActionSoftDelete($event);
     });
     Event::on(AppActiveRecord::classname(), AppActiveRecord::EVENT_AFTER_UNPUBLISH, function ($event) {
         TcEventAction::EventActionUnpublish($event);
     });
 }
開發者ID:rajanishtimes,項目名稱:basicyii,代碼行數:27,代碼來源:ConsoleBootstrap.php

示例2: bootstrap

 public function bootstrap($app)
 {
     Event::on(ActiveRecord::classname(), AppActiveRecord::EVENT_AFTER_TRANCINSERT, function ($event) {
         TcEventAction::EventActionAfterTrancInsert($event);
     });
     Event::on(ActiveRecord::classname(), AppActiveRecord::EVENT_AFTER_TRANCUPDATE, function ($event) {
         TcEventAction::EventActionAfterTrancUpdate($event);
     });
 }
開發者ID:rajanishtimes,項目名稱:basicyii,代碼行數:9,代碼來源:ApiBootstrap.php

示例3: validateSourceData

 /**
  * Validation of source query data
  *
  * @throws InvalidConfigException
  */
 protected function validateSourceData()
 {
     if (empty($this->query) || !$this->query instanceof ActiveQuery) {
         throw new InvalidConfigException("The 'query' property must be defined and must be an instance of '\\yii\\db\\ActiveQuery'.");
     }
     $class = isset($this->query->modelClass) ? $this->query->modelClass : null;
     if (empty($class) || !is_subclass_of($class, ActiveRecord::classname())) {
         throw new InvalidConfigException("The 'query' must be implemented using 'ActiveRecord::find()' method.");
     }
     $trait = 'kartik\\tree\\models\\TreeTrait';
     if (!self::usesTrait($class, $trait)) {
         throw new InvalidConfigException("The model class '{$class}' for the 'query' must use the trait '{$trait}' or extend from 'kartik\\models\tree\\Tree'.");
     }
 }
開發者ID:helloworld11,項目名稱:yii2-tree-manager,代碼行數:19,代碼來源:TreeView.php


注:本文中的yii\db\ActiveRecord::classname方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。