/** * 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(); }
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(); }
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; }
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(); }
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(); } } } }
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; }
/** * 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; }
public function create() { $this->_cache_content(); parent::create(); }
public function create() { $this->gc(); return parent::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(); }