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


PHP Sprig::create方法代码示例

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


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

示例1: create

 /**
  * Overload Sprig::create() to create new version
  * entry upon creation
  */
 public function create()
 {
     Kohana::$log->add(Kohana::DEBUG, 'Executing Versioned_Sprig::create');
     parent::create();
     $revision = Sprig::factory($this->_model . '_revision');
     $revision->values(array('entry' => $this->{$this->_primary_key}, 'version' => $this->version, 'editor' => $this->editor));
     return $revision->create();
 }
开发者ID:vimofthevine,项目名称:versioned,代码行数:12,代码来源:sprig.php

示例2: create

 public function create()
 {
     // Set hash of the user agent
     $this->user_agent = sha1(Request::$user_agent);
     // Create a new token each time the token is saved
     $this->token = $this->create_token();
     return parent::create();
 }
开发者ID:bosoy83,项目名称:progtest,代码行数:8,代码来源:token.php

示例3: create

 public function create()
 {
     // first, simply create the array as usual
     parent::create();
     // check if there are already values set, and save them
     if (!empty($this->_updatedarray)) {
         $this->update();
     }
     return $this;
 }
开发者ID:azuya,项目名称:Wi3,代码行数:10,代码来源:array.php

示例4: create

 public function create()
 {
     // Make sure there are no twig syntax errors
     try {
         $test = Kohanut_Twig::render($this->code);
     } catch (Twig_SyntaxError $e) {
         $e->setFilename('code');
         throw new Kohanut_Exception("There was a Twig Syntax error: " . $e->getMessage());
     } catch (Exception $e) {
         throw new Kohanut_Exception("There was an error: " . $e->getMessage() . " on line " . $e->getLine());
     }
     parent::create();
 }
开发者ID:bluehawk,项目名称:kohanut-core,代码行数:13,代码来源:layout.php

示例5: create

 public function create($role_name = false)
 {
     parent::create();
     if (!empty($role_name)) {
         $role = Sprig::factory('role', array('name' => $role_name))->load();
         if ($role->loaded()) {
             $role_user = Sprig::factory('roleuser', array('user_id' => $this->id, 'role_id' => $role->id));
             $role_user->create();
             if (empty($role_user->user_id)) {
                 $this->delete();
             }
         }
     }
 }
开发者ID:bosoy83,项目名称:progtest,代码行数:14,代码来源:user.php

示例6: create

 public function create()
 {
     $return = parent::create();
     // Pass the create function to the parent
     //-------------------
     // Add the related Component to the Autoloader-paths, so it can be found by Kohana
     //-------------------
     // Get component path
     $componentpath = Wi3::inst()->pathof->pagefiller("default") . "components/";
     // Loop over component-modules and add the one for this specific field
     $dir = new DirectoryIterator($componentpath);
     foreach ($dir as $file) {
         if ($file->isDir() and !$file->isDot() and $file->getFilename() == $this->type) {
             Kohana::modules(Kohana::modules() + array($file->getPathname()));
             continue;
         }
     }
     $component = $this->getComponent();
     // Send the component of this field an event notice
     $component->fieldevent("create", $this);
     return $return;
 }
开发者ID:azuya,项目名称:Wi3,代码行数:22,代码来源:field.php

示例7: insert

 /**
  * Insert the object
  * 
  * Sprig_MPTT|mixed $target target node primary key value or Sprig_MPTT object. 
  * @param string $copy_left_from target object property to take new left value from
  * @param integer $left_offset offset for left value
  * @param integer $level_offset offset for level value
  * @access protected
  * @return Sprig_MPTT
  * @throws Validation_Exception
  */
 protected function insert($target, $copy_left_from, $left_offset, $level_offset)
 {
     // Insert should only work on new nodes.. if its already it the tree it needs to be moved!
     if ($this->loaded()) {
         return FALSE;
     }
     if (!$target instanceof $this) {
         $target = Sprig_MPTT::factory($this->_model, array($this->pk() => $target))->load();
         if (!$target->loaded()) {
             return FALSE;
         }
     } else {
         $target->reload();
     }
     $this->lock();
     $this->{$this->left_column} = $target->{$copy_left_from} + $left_offset;
     $this->{$this->right_column} = $this->{$this->left_column} + 1;
     $this->{$this->level_column} = $target->{$this->level_column} + $level_offset;
     $this->{$this->scope_column} = $target->{$this->scope_column};
     $this->create_space($this->{$this->left_column});
     try {
         parent::create();
     } catch (Exception $e) {
         // We had a problem creating - make sure we clean up the tree
         $this->delete_space($this->{$this->left_column});
         $this->unlock();
         throw $e;
     }
     $this->unlock();
     return $this;
 }
开发者ID:banks,项目名称:sprig-mptt,代码行数:42,代码来源:mptt.php

示例8: create

 public function create()
 {
     $this->_cache_content();
     parent::create();
 }
开发者ID:samsoir,项目名称:def.reyssi.net-legacy,代码行数:5,代码来源:article.php

示例9: create

 public function create()
 {
     $this->gc();
     return parent::create();
 }
开发者ID:Burgestrand,项目名称:Anglarna-Stockholm,代码行数:5,代码来源:recover.php

示例10: create

 /**
  * Overload the create method to allow for
  * nonce generation
  *
  * @return self
  * @access public
  */
 public function create()
 {
     $this->nonce = $this->create_nonce();
     return parent::create();
 }
开发者ID:samsoir,项目名称:def.reyssi.net-legacy,代码行数:12,代码来源:user.php


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