当前位置: 首页>>代码示例>>PHP>>正文


PHP BaseModel::initialize方法代码示例

本文整理汇总了PHP中BaseModel::initialize方法的典型用法代码示例。如果您正苦于以下问题:PHP BaseModel::initialize方法的具体用法?PHP BaseModel::initialize怎么用?PHP BaseModel::initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BaseModel的用法示例。


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

示例1: initialize

 /**
  * 模型初始化
  */
 public function initialize()
 {
     parent::initialize();
     //关联users表
     $this->belongsTo("author_id", "Blog\\Models\\Users", "id", array('alias' => 'Author'));
     $this->belongsTo("question_id", "Blog\\Models\\Questions", "id", array('alias' => 'Question'));
 }
开发者ID:hongker,项目名称:Blog,代码行数:10,代码来源:Answers.php

示例2: initialize

 /**
  * 模型初始化
  */
 public function initialize()
 {
     parent::initialize();
     //关联users表
     $this->belongsTo("author_id", "Blog\\Models\\Users", "id", array('alias' => 'Author'));
     $this->skipAttributesOnUpdate(array('author_id', 'target_id', 'type'));
 }
开发者ID:hongker,项目名称:Blog,代码行数:10,代码来源:Scores.php

示例3: initialize

 public function initialize()
 {
     parent::initialize();
     $this->setSource('book_instances');
     $this->belongsTo('book_id', "App\\Models\\Book", 'id', ["alias" => "book"]);
     $this->belongsTo('user_id', "App\\Models\\User", 'id', ["alias" => "user"]);
 }
开发者ID:vladylen,项目名称:phalcon,代码行数:7,代码来源:BookInstance.php

示例4: initialize

 public function initialize()
 {
     parent::initialize();
     $database = new Elements();
     $database = $database->getDatabase();
     $this->setConnectionService($database);
 }
开发者ID:qcww,项目名称:yh_cms,代码行数:7,代码来源:CustomBase.php

示例5: initialize

 /**
  * 模型初始化
  */
 public function initialize()
 {
     parent::initialize();
     //关联users表
     $this->belongsTo("author_id", "Blog\\Models\\Users", "id", array('alias' => 'Author'));
     $this->belongsTo("target_id", "Blog\\Models\\Users", "id", array('alias' => 'Target'));
     $this->belongsTo("comment_id", "Blog\\Models\\Comments", "id", array('alias' => 'Comment'));
 }
开发者ID:hongker,项目名称:Blog,代码行数:11,代码来源:Replies.php

示例6: initialize

 /**
  * 模型初始化
  */
 public function initialize()
 {
     parent::initialize();
     //关联users表
     $this->belongsTo("author_id", "Blog\\Models\\Users", "id", array('alias' => 'Author'));
     //关联articles表
     $this->belongsTo("target_id", "Blog\\Models\\Articles", "id", array('alias' => 'Article'));
     $this->hasMany("id", "Blog\\Models\\Replies", "comment_id", array('alias' => 'Replies'));
 }
开发者ID:hongker,项目名称:Blog,代码行数:12,代码来源:Comments.php

示例7: initialize

 public function initialize()
 {
     parent::initialize();
     $this->hasMany('id', 'ST\\Common\\Models\\BookComment', 'uid', ['alias' => 'bookComment']);
     $this->belongsTo('school_id', 'ST\\Common\\Models\\School', 'id', ['alias' => 'school']);
     $this->belongsTo('classes_id', 'ST\\Common\\Models\\Classes', 'id', ['alias' => 'classes']);
 }
开发者ID:ylh990835774,项目名称:phalcon_ydjc,代码行数:7,代码来源:User.php

示例8: initialize

 public function initialize()
 {
     parent::initialize();
     $this->hasMany('id', 'ST\\Common\\Models\\Book', 'cid', ['alias' => 'book']);
 }
开发者ID:ylh990835774,项目名称:phalcon_ydjc,代码行数:5,代码来源:BookCate.php

示例9: initialize

 public function initialize()
 {
     parent::initialize();
     $this->table = $this->prefix . $this->table;
 }
开发者ID:qcww,项目名称:yh_cms,代码行数:5,代码来源:Custom.php

示例10: initialize

 public function initialize()
 {
     parent::initialize();
     $this->belongsTo('classes_id', 'ST\\Common\\Models\\Classes', 'id', ['alias' => 'classes']);
 }
开发者ID:ylh990835774,项目名称:phalcon_ydjc,代码行数:5,代码来源:Statistics.php

示例11: initialize

 public function initialize()
 {
     parent::initialize();
     $this->belongsTo('book_id', 'ST\\Common\\Models\\Book', 'id', ['alias' => 'book']);
     $this->belongsTo('uid', 'ST\\Common\\Models\\User', 'id', ['alias' => 'user']);
     $this->belongsTo('classes_id', 'ST\\Common\\Models\\Classes', 'id', ['alias' => 'classes']);
     $this->hasMany('id', 'ST\\Common\\Models\\Note', 'read_task_id', ['alias' => 'note']);
 }
开发者ID:ylh990835774,项目名称:phalcon_ydjc,代码行数:8,代码来源:Task.php

示例12: initialize

 public function initialize()
 {
     parent::initialize();
     $this->belongsTo('eva_task_id', 'ST\\Common\\Models\\EvaTask', 'id', ['alias' => 'eva_task']);
     $this->belongsTo('uid', 'ST\\Common\\Models\\User', 'id', ['alias' => 'user']);
     $this->belongsTo('book_id', 'ST\\Common\\Models\\Book', 'id', ['alias' => 'book']);
     $this->belongsTo('classes_id', 'ST\\Common\\Models\\Classes', 'id', ['alias' => 'classes']);
     $this->belongsTo('read_task_id', 'ST\\Common\\Models\\Task', 'id', ['alias' => 'task']);
 }
开发者ID:ylh990835774,项目名称:phalcon_ydjc,代码行数:9,代码来源:EvaTaskLog.php

示例13: initialize

 /**
  * 模型初始化
  */
 public function initialize()
 {
     parent::initialize();
     //关联users表
     $this->hasMany("id", "Blog\\Models\\Articles", "type_id", array('alias' => 'Articles'));
 }
开发者ID:hongker,项目名称:Blog,代码行数:9,代码来源:Types.php

示例14: initialize

 /**
  * 模型初始化
  */
 public function initialize()
 {
     parent::initialize();
     $this->skipAttributesOnCreate(array('status'));
 }
开发者ID:hongker,项目名称:Blog,代码行数:8,代码来源:Advices.php

示例15: initialize

 public function initialize()
 {
     parent::initialize();
     //多本书对一个分类
     $this->belongsTo('cid', 'ST\\Common\\Models\\BookCate', 'id', ['alias' => 'bookCate']);
     //一本书有多个评论
     $this->hasMany('id', 'ST\\Common\\Models\\BookComment', 'book_id', ['alias' => 'bookComment']);
     $this->belongsTo('uid', 'ST\\Common\\Models\\User', 'id', ['alias' => 'user']);
 }
开发者ID:ylh990835774,项目名称:phalcon_ydjc,代码行数:9,代码来源:Book.php


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