• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP models\BaseModel类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中app\models\BaseModel的典型用法代码示例。如果您正苦于以下问题:PHP BaseModel类的具体用法?PHP BaseModel怎么用?PHP BaseModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了BaseModel类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: beforeRender

 protected function beforeRender()
 {
     parent::beforeRender();
     $user_id = $this->user->id;
     if ($this->user->isLoggedIn() and $user_id != NULL) {
         $css = $this->baseModel->getCss($user_id);
         $this->template->userCss = $css->style;
     } else {
         $this->template->userCss = 1;
     }
 }
开发者ID:norik16,项目名称:TripMap,代码行数:11,代码来源:BasePresenter.php


示例2: c

 public function c($rq = null)
 {
     $type = ['employee' => 1, 'agency' => 2, 'doctor' => 3];
     $rq = rq();
     $rq['senderid'] = uid();
     $rq['sendername'] = username();
     if (he_is('agency')) {
         $rq['org'] = sess('org');
     }
     if (he_is('employee')) {
         $rq['org'] = sess('org');
     }
     // return his_chara()[0];
     $rq['sendertype'] = $type[his_chara()[0]];
     if (his_chara()[0] == 'agency') {
         $rq['recipienttype'] = 1;
         $rq['recipientid'] = 1;
         $rq['recipientname'] = 'admin';
     } elseif (his_chara()[0] == 'employee') {
         $rq['recipienttype'] = $type[$rq['recipienttype']];
     }
     // 验证发信规则
     $valid = $this->verify($rq);
     if (!$valid) {
         return ee(2);
     }
     $rq['sendtime'] = date("Y-m-d H:i:s");
     return parent::c($rq);
 }
开发者ID:newset,项目名称:robot,代码行数:29,代码来源:IMessage.php


示例3: beforeValidate

 public function beforeValidate()
 {
     if (!$this->expires) {
         $this->expires = strtotime(Yii::$app->params['user']['reset_timeout']);
     }
     return parent::beforeValidate();
 }
开发者ID:ethercreative,项目名称:yii2-app-api,代码行数:7,代码来源:Reset.php


示例4: initialize

 public function initialize()
 {
     parent::initialize();
     $this->setSource($this->className());
     $this->belongsTo('user_id', 'App\\Models\\User', 'id', ['alias' => 'User', 'foreignKey' => ['message' => 'The user_id does not exist on the User model']]);
     $this->belongsTo('provider_id', 'App\\Models\\Provider', 'id', ['alias' => 'Provider', 'foreignKey' => ['message' => 'The provider_id does not exist on the Provider model']]);
 }
开发者ID:soutoner,项目名称:api-desconecta,代码行数:7,代码来源:Profile.php


示例5: initialize

 public function initialize()
 {
     parent::initialize();
     $this->setSource($this->className());
     $this->hasManyToMany('id', 'App\\Models\\Relationships\\EventHasHashTag', 'hashTag_id', 'event_id', 'App\\Models\\Event', 'id', ['alias' => 'Events']);
     $this->hasManyToMany('id', 'App\\Models\\Relationships\\PhotoHasHashTag', 'hashTag_id', 'photo_id', 'App\\Models\\Photo', 'id', ['alias' => 'Photos']);
 }
开发者ID:soutoner,项目名称:api-desconecta,代码行数:7,代码来源:HashTag.php


示例6: initialize

 public function initialize()
 {
     parent::initialize();
     $this->setSource($this->className());
     $this->belongsTo('period_id', 'App\\Models\\Period', 'id', ['alias' => 'Period', 'foreignKey' => ['message' => 'The period_id does not exist on the Period model']]);
     $this->hasOne('id', 'App\\Models\\Event', 'scheduling_id', ['alias' => 'Event']);
 }
开发者ID:soutoner,项目名称:api-desconecta,代码行数:7,代码来源:Scheduling.php


示例7: __construct

 public function __construct(array $attributes = [])
 {
     parent::__construct($attributes);
     if (app()->environment() === 'production') {
         $this->setConnection('mysql-hr');
     }
 }
开发者ID:jrsalunga,项目名称:gi-cashier,代码行数:7,代码来源:Branch.php


示例8: initialize

 public function initialize()
 {
     parent::initialize();
     $this->setSource($this->className());
     $this->hasOne('id', 'App\\Models\\Event', 'guestList_id', ['alias' => 'Event']);
     $this->hasManyToMany('id', 'App\\Models\\Relationships\\Belong', 'guestList_id', 'user_id', 'App\\Models\\User', 'id', ['alias' => 'Users']);
 }
开发者ID:soutoner,项目名称:api-desconecta,代码行数:7,代码来源:GuestList.php


示例9: initialize

 public function initialize()
 {
     parent::initialize();
     $this->setSource($this->className());
     $this->hasOne('id', 'App\\Models\\User', 'rrpp_id', ['alias' => 'User']);
     $this->hasMany('id', 'App\\Models\\Local', 'owner_id', ['alias' => 'Locals']);
 }
开发者ID:soutoner,项目名称:api-desconecta,代码行数:7,代码来源:RRPP.php


示例10: r

 public function r()
 {
     if (Input::get('log')) {
         $this->eventFire('r', rq('id'));
     }
     return parent::r();
 }
开发者ID:newset,项目名称:robot,代码行数:7,代码来源:IMark.php


示例11: setAttribute

 public function setAttribute($key, $value)
 {
     $isRememberTokenAttribute = $key == $this->getRememberTokenName();
     if (!$isRememberTokenAttribute) {
         parent::setAttribute($key, $value);
     }
 }
开发者ID:josmel,项目名称:hostpots,代码行数:7,代码来源:User.php


示例12: boot

 protected static function boot()
 {
     parent::boot();
     static::deleting(function ($image) {
         Storage::delete('uploads/m/' . $image->path . $image->key);
     });
 }
开发者ID:sonoftheweb,项目名称:laravel-angular-cms,代码行数:7,代码来源:Media.php


示例13: boot

 /**
  * The "booting" method of the model.
  *
  * @return void
  */
 public static function boot()
 {
     parent::boot();
     static::saving(function ($item) {
         $item->key = $item->key;
     });
 }
开发者ID:AccessibilityNL,项目名称:User-Testing-Tool,代码行数:12,代码来源:Member.php


示例14:

 function __construct($init = [])
 {
     if (is_array($init)) {
         return parent::__construct($init);
     } else {
         $this->name = $init;
     }
 }
开发者ID:prkeshri,项目名称:getpanel,代码行数:8,代码来源:Column.php


示例15: u

 /**
  * 更新
  */
 public function u($rq = NULL)
 {
     $this->guarded = arr_except_vals($this->guarded, ['password']);
     if (!$rq) {
         $rq = rq();
     }
     return parent::u($rq);
 }
开发者ID:newset,项目名称:robot,代码行数:11,代码来源:IEmployee.php


示例16: initialize

 public function initialize()
 {
     parent::initialize();
     $this->setSource($this->className());
     $this->belongsTo('event_id', 'App\\Models\\Event', 'id', ['alias' => 'Event', 'foreignKey' => ['message' => 'The event_id does not exist on the Event model']]);
     $this->hasManyToMany('id', 'App\\Models\\Relationships\\Appear', 'photo_id', 'user_id', 'App\\Models\\User', 'id', ['alias' => 'UsersAppearing']);
     $this->hasManyToMany('id', 'App\\Models\\Relationships\\PhotoHasHashTag', 'photo_id', 'hashTag_id', 'App\\Models\\HashTag', 'id', ['alias' => 'HashTags']);
 }
开发者ID:soutoner,项目名称:api-desconecta,代码行数:8,代码来源:Photo.php


示例17: __construct

 public function __construct()
 {
     parent::__construct();
     $this->table = table_name($this->ins_name, 'i');
     $this->createRule = ['email' => 'required|email', 'name' => 'required', 'phone' => 'required'];
     $this->updateRule = ['email' => 'required|email', 'name' => 'required', 'phone' => 'required'];
     $this->messages = ['phone.required' => '手机号码必填', 'email.required' => '电子邮箱必填', 'email.email' => '邮箱格式有误'];
 }
开发者ID:newset,项目名称:robot,代码行数:8,代码来源:IDoctor.php


示例18: initialize

 public function initialize()
 {
     parent::initialize();
     $this->setSource($this->className());
     $this->belongsTo('owner_id', 'App\\Models\\RRPP', 'id', ['alias' => 'Owner', 'foreignKey' => ['message' => 'The owner_id does not exist on the RRPP model']]);
     $this->hasMany('id', 'App\\Models\\Event', 'local_id', ['alias' => 'Events']);
     $this->hasManyToMany('id', 'App\\Models\\Relationships\\Follow', 'local_id', 'user_id', 'App\\Models\\User', 'id', ['alias' => 'Followers']);
 }
开发者ID:soutoner,项目名称:api-desconecta,代码行数:8,代码来源:Local.php


示例19: beforeSave

 public function beforeSave($insert)
 {
     parent::beforeSave($insert);
     $this->url_code = \app\common\XUtils::shorturl($this->url);
     $this->description = \app\common\XUtils::ihtmlspecialchars($this->description);
     !$this->id && ($this->createtime = time());
     $this->updatetime = time();
     return true;
 }
开发者ID:HabiCat,项目名称:searchkeyword,代码行数:9,代码来源:WPost.php


示例20: __construct

 public function __construct()
 {
     parent::__construct();
     $this->table = table_name($this->ins_name, 'i');
     // $this->createRule = [
     //     'email' => 'required|email',
     //     'name' => 'required'
     // ];
 }
开发者ID:Aaronqcd,项目名称:robot,代码行数:9,代码来源:IDoctor.php



注:本文中的app\models\BaseModel类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP models\Book类代码示例发布时间:2022-05-23
下一篇:
PHP models\Authors类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap