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


PHP Kohana::unserialize方法代码示例

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


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

示例1: _load_values

 protected function _load_values(array $values)
 {
     if (!empty($values['data'])) {
         $values['data'] = Kohana::unserialize($values['data']);
     }
     parent::_load_values($values);
 }
开发者ID:ZerGabriel,项目名称:cms-1,代码行数:7,代码来源:setting.php

示例2: code

 public function code()
 {
     if ($this->_code === FALSE) {
         try {
             $this->_code = Kohana::unserialize($this->code);
         } catch (Exception $e) {
             $this->_code = new Model_Widget_HTML();
         }
         $this->_code->id = $this->id;
     }
     return $this->_code;
 }
开发者ID:ZerGabriel,项目名称:cms-1,代码行数:12,代码来源:widget.php

示例3: find_by_keyword

 /**
  * 
  * @param string $keyword
  * @param boolean $only_title
  * @param string $modules
  * @param integer $limit
  * @param integer $offset
  * @return array
  */
 public function find_by_keyword($keyword, $only_title = FALSE, $modules = NULL, $limit = 50, $offset = 0)
 {
     if (Kohana::$profiling === TRUE) {
         $benchmark = Profiler::start('Search', __FUNCTION__);
     }
     $query = DB::select('id', 'module', 'title', 'annotation', 'params')->from('search_index');
     $result = $this->_get_query($query, $keyword, $only_title, $modules, $limit, $offset)->execute()->as_array();
     $ids = array();
     foreach ($result as $row) {
         $row['params'] = Kohana::unserialize($row['params']);
         $ids[$row['module']][$row['id']] = $row;
     }
     if (isset($benchmark)) {
         Profiler::stop($benchmark);
     }
     return $ids;
 }
开发者ID:ZerGabriel,项目名称:cms-1,代码行数:26,代码来源:mysql.php

示例4: get

 /**
  * 
  * @param string $key
  * @param mixed $default
  * @param integer $user_id
  * @return mixed
  */
 public static function get($key, $default = NULL, $user_id = NULL)
 {
     if ($user_id === NULL) {
         $user_id = Auth::get_id();
     }
     self::_load($user_id);
     $value = Arr::path(self::$_cache, $user_id . '.' . $key);
     if ($value !== NULL) {
         return @Kohana::unserialize($value);
     } else {
         if ($user_id === 0) {
             return $default;
         }
         self::_load(0);
         $value = Arr::path(self::$_cache, 0 . '.' . $key);
         if ($value !== NULL) {
             return @Kohana::unserialize($value);
         } else {
             return $default;
         }
     }
 }
开发者ID:ZerGabriel,项目名称:cms-1,代码行数:29,代码来源:meta.php

示例5: load_from_array

 /**
  * 
  * @param array $data
  * @return Model_Widget_Decorator
  */
 public static function load_from_array(array $data)
 {
     if (empty($data) or !self::exists_by_type($data['type'])) {
         return NULL;
     }
     $widget = Kohana::unserialize($data['code']);
     unset($data['code'], $data['type']);
     foreach ($data as $key => $value) {
         $widget->{$key} = $value;
     }
     self::$_cache[$widget->id] = $widget;
     return $widget;
 }
开发者ID:ZerGabriel,项目名称:cms-1,代码行数:18,代码来源:manager.php

示例6: data

 public function data()
 {
     return Kohana::unserialize($this->data);
 }
开发者ID:ZerGabriel,项目名称:cms-1,代码行数:4,代码来源:type.php

示例7: unserialize

 /**
  * Prepares the database connection and reloads the object.
  *
  * @param string $data String for unserialization
  * @return  void
  */
 public function unserialize($data)
 {
     // Initialize model
     $this->_initialize();
     foreach (Kohana::unserialize($data) as $name => $var) {
         $this->{$name} = $var;
     }
     if ($this->_reload_on_wakeup === TRUE) {
         // Reload the object
         $this->reload();
     }
 }
开发者ID:ZerGabriel,项目名称:cms-1,代码行数:18,代码来源:orm.php

示例8: _load_settings

 /**
  * Загрузка параметров плагина из БД
  *
  * @return \Plugin_Decorator
  */
 protected function _load_settings()
 {
     $settings = DB::select('settings')->from(Plugin::TABLE_NAME)->where('id', '=', $this->id())->cache_key(Plugin::CACHE_KEY . '::plugin::' . $this->id())->cached(Date::DAY)->limit(1)->execute()->get('settings');
     $this->_settings = !empty($settings) ? Kohana::unserialize($settings) : array();
     return $this;
 }
开发者ID:ZerGabriel,项目名称:cms-1,代码行数:11,代码来源:database.php

示例9: load_from_array

 /**
  * Загрузка разедла из массива данных
  * 
  * @param array $data
  * @return Datasource_Section
  */
 public static function load_from_array(array $data)
 {
     $section = Kohana::unserialize($data['code']);
     $section->_id = $data['id'];
     $section->name = $data['name'];
     $section->description = Arr::get($data, 'description');
     $section->_docs = (int) Arr::get($data, 'docs');
     $section->_is_indexable = (bool) Arr::get($data, 'indexed');
     $section->_created_by_id = (int) Arr::get($data, 'created_by_id');
     $section->_folder_id = (int) Arr::get($data, 'folder_id');
     return $section;
 }
开发者ID:ZerGabriel,项目名称:cms-1,代码行数:18,代码来源:section.php

示例10: get_field_from_array

 /**
  * Преобразование массива в объект поля
  * 
  * @see DataSource_Hybrid_Field_Factory::get_fields()
  * 
  * @param array $array
  * @return null|\DataSource_Hybrid_Field
  * @throws Kohana_Exception
  */
 public static function get_field_from_array(array $array = NULL)
 {
     if (empty($array) or !isset($array['type'])) {
         return NULL;
     }
     $class_name = 'DataSource_Hybrid_Field_' . $array['type'];
     if (!class_exists($class_name)) {
         return NULL;
     }
     if (isset($array['props'])) {
         $props = Kohana::unserialize($array['props']);
         unset($array['props']);
         if (is_array($props)) {
             $array = Arr::merge($array, $props);
         }
     }
     $result = DataSource_Hybrid_Field::factory($array['type'], $array);
     $result->set_id(Arr::get($array, 'id'));
     $result->set_ds(Arr::get($array, 'ds_id'));
     return $result;
 }
开发者ID:ZerGabriel,项目名称:cms-1,代码行数:30,代码来源:factory.php


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