当前位置: 首页>>代码示例>>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;未经允许,请勿转载。