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


PHP ORM::create方法代码示例

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


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

示例1: createmodels

 public function createmodels()
 {
     if (!auth::check(self::AUTH_REALM)) {
         $this->access_denied();
     }
     $created = 0;
     $models = $this->getModels();
     foreach ($models as $id => $model) {
         if (!$model['status']) {
             $created++;
             $filename = substr($model['info']['basename'], 0, strpos($model['info']['basename'], '.xml'));
             ORM::create($filename);
         }
     }
     $this->msg = "<strong>{$created} models</strong> created successfuly.";
     $this->database();
 }
开发者ID:rev087,项目名称:kennel,代码行数:17,代码来源:ksetup.php

示例2: create

 /**
  * Wrap Idiorm's create method to return an
  * empty instance of the class associated with
  * this wrapper instead of the raw ORM class.
  *
  *  return ORMWrapper|bool
  */
 public function create($data = null)
 {
     return $this->_create_model_instance(parent::create($data));
 }
开发者ID:florinp,项目名称:dexonline,代码行数:11,代码来源:paris.php

示例3: create

 public function create(Validation $validation = null)
 {
     $this->token = $this->create_token();
     return parent::create($validation);
 }
开发者ID:s4urp8n,项目名称:kohana-admin,代码行数:5,代码来源:Token.php

示例4: create

 /**
  * Insert a new object to the database
  * @param  Validation $validation Validation object
  * @return ORM
  */
 public function create(Validation $validation = NULL)
 {
     parent::create($validation);
     $this->reload_config();
 }
开发者ID:Wildboard,项目名称:WbWebApp,代码行数:10,代码来源:config.php

示例5: create

 public function create(Validation $validation = NULL)
 {
     $user = user::get();
     $this->user_id = $user->id;
     $this->created = $user->timestamp();
     $this->day = user::get()->today_slug();
     return parent::create($validation);
 }
开发者ID:artbypravesh,项目名称:morningpages,代码行数:8,代码来源:Page.php

示例6: create

 /**
  * Wrap Idiorm's create method to return an
  * empty instance of the class associated with
  * this wrapper instead of the raw ORM class.
  *
  * @param array $data associate array of data to fill the model
  *
  * @return Model
  */
 public function create($data = null)
 {
     return $this->createModelInstance(parent::create($data));
 }
开发者ID:kevinsperrine,项目名称:paris,代码行数:13,代码来源:OrmWrapper.php

示例7: create

 /**
  * Override the create method with defaults
  *
  * @param   Validation $validation  Validation object [Optional]
  *
  * @return  ORM
  *
  * @throws  Gleez_Exception
  */
 public function create(Validation $validation = NULL)
 {
     if ($this->_loaded) {
         throw new Gleez_Exception('Cannot create :model model because it is already loaded.', array(':model' => $this->_object_name));
     }
     $this->init = $this->mail;
     $this->status = 1;
     return parent::create($validation);
 }
开发者ID:ultimateprogramer,项目名称:cms,代码行数:18,代码来源:user.php

示例8: get_block

     $block = ORM::factory('blocktype')->where('contenttype_id', '=', $this->content->contenttype_id)->where('key', '=', $key)->find();
     if ((bool) $block->loaded()) {
         $block = $this->blocks->where('blocktype_id', '=', $block->id)->find_all();
         if ((bool) $block->count()) {
             return $block;
         }
     }
     return false;
 }
 // alias
 public function get_block($key)
 {
     return $this->get_block_by_key($key);
 }
 public function get_blocks()
 {
     return $this->blocks->where('parent', '=', $this->id)->find_all();
 }
 public function create(Validation $validation = NULL)
 {
开发者ID:artbypravesh,项目名称:morningpages,代码行数:20,代码来源:Block.php

示例9: save

 /**
  * Saves the current object. Will hash password if it was changed.
  *
  * @return  ORM
  */
 public function save()
 {
     if (array_key_exists('password', $this->_changed)) {
         $this->_object['password'] = Auth::instance()->hash_password($this->_object['password']);
     }
     if (isset($this->_object['id'])) {
         return parent::update();
     } else {
         return parent::create();
     }
 }
开发者ID:JustLikeIcarus,项目名称:auth,代码行数:16,代码来源:user.php

示例10: create

 public function create(Validation $validation = NULL)
 {
     $this->created = time();
     return parent::create($validation);
 }
开发者ID:artbypravesh,项目名称:morningpages,代码行数:5,代码来源:Talkreply.php


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