__set() 공개 메소드

public __set ( $key, $value )
예제 #1
0
 public function __set($prop, $value)
 {
     if ('name' == $prop) {
         $value = url::title($value);
     }
     parent::__set($prop, $value);
 }
예제 #2
0
 public function __set($col, $value)
 {
     if ('end_time' == $col || 'start_time' == $col) {
         $value = date('Y-m-d H:i:s', strtotime($value));
     }
     return parent::__set($col, $value);
 }
예제 #3
0
 public function __set($key, $value)
 {
     if ($key === 'password') {
         $value = md5($value);
     }
     parent::__set($key, $value);
 }
예제 #4
0
 /**
  * Whenever setting the slug, make sure that it conforms to requirements
  * @developer Brandon Hansen
  * @date Oct 26, 2010
  */
 public function __set($key, $value)
 {
     if ($key == 'slug') {
         $value = format::pretty_url($value);
     }
     parent::__set($key, $value);
 }
예제 #5
0
 public function __set($column, $value)
 {
     if ($column === 'uri') {
         $value = serialize($value);
     }
     parent::__set($column, $value);
 }
예제 #6
0
 public function __set($key, $value)
 {
     if ($key == "translated_on") {
         parent::__set($key, gmdate("Y-m-d H:i:s", $value));
     }
     return parent::__set($key, $value);
 }
 /**
  * Override set handler to trap pointers in to_occurrence_id to occurrences that don't yet
  * exist, because they come later in the submission. These values come in the form
  * ||pointer||. We have to temporarily null out the field, then store the pointer for
  * later.
  */
 public function __set($key, $value)
 {
     if (substr($key, -16) === 'to_occurrence_id' && preg_match('/^||.+||$/', $value)) {
         $this->to_occurrence_id_pointer = str_replace('||', '', $value);
         $value = null;
     }
     parent::__set($key, $value);
 }
예제 #8
0
 public function __set($key, $value)
 {
     if ($key === $this->config['columns']['password']) {
         // Use Auth to hash the password
         $value = Security::instance($this->config_name)->hash_password($value);
     }
     parent::__set($key, $value);
 }
예제 #9
0
 /**
  * Encrypt the data before saving, also stripping out an html
  * @Developer brandon
  * @Date May 18, 2010
  */
 public function __set($key, $value)
 {
     if (in_array($key, array('content', 'title'))) {
         $encrypt = new Encrypt();
         $value = $encrypt->encode(strip_tags($value));
     }
     parent::__set($key, $value);
 }
예제 #10
0
 public function __set($key, $value)
 {
     if ($key === 'password') {
         // Use Auth to hash the password
         $value = Auth::instance()->hash_password($value);
     }
     parent::__set($key, $value);
 }
예제 #11
0
파일: tag.php 프로젝트: kolanos/kohana-tags
 public function __set($key, $value)
 {
     if ($key === 'tags') {
         // Set tag to url-safe format
         $value = url::title($value);
     }
     parent::__set($key, $value);
 }
예제 #12
0
 public function __set($prop, $value)
 {
     Kohana::log('debug', $prop . ' -> ' . Kohana::debug($value));
     if ('tags' == $prop && is_string($value)) {
         return $this->set_tags($value);
     }
     return parent::__set($prop, $value);
 }
예제 #13
0
 public function __set($prop, $value)
 {
     if ('user' == $prop || 'project' == $prop) {
         $prop .= '_id';
         $value = $value->id;
     }
     return parent::__set($prop, $value);
 }
예제 #14
0
 /**
  * Ensure that the rules are always followed
  * @Developer brandon
  * @Date Oct 12, 2010
  */
 public function __set($key = NULL, $value = NULL)
 {
     if ($key == 'quantity') {
         // Make sure that we always have a positive integer
         $value = max(1, (int) $value);
     }
     parent::__set($key, $value);
 }
예제 #15
0
파일: local.php 프로젝트: jimktrains/rccms
 public function __set($key, $value)
 {
     #		kohana::auto_load('Driver_Auth_Local');
     if (!strcmp($key, 'password') or !strcmp($key, 'password_confirm')) {
         $value = Model_Auth_local::hash_password($value);
     }
     parent::__set($key, $value);
 }
예제 #16
0
 public function __set($key, $value)
 {
     if ($key === 'password') {
         // Use Account to hash the password
         # todo fix this.
         $value = Account::instance()->hash_password($value);
     }
     parent::__set($key, $value);
 }
예제 #17
0
 public function __set($column, $value)
 {
     switch ($column) {
         case "password":
             $value = user::hash_password($value);
             break;
     }
     parent::__set($column, $value);
 }
예제 #18
0
 public function __set($key, $value)
 {
     if ($key === 'status_id') {
         if ($value == 2) {
             $this->tweet();
             $this->ping_technorati();
         }
     }
     parent::__set($key, $value);
 }
예제 #19
0
 public function __set($column, $value)
 {
     switch ($column) {
         case 'installer':
             parent::__set($column, (int) $value);
             break;
         default:
             parent::__set($column, $value);
             break;
     }
 }
예제 #20
0
 public function __set($column, $value)
 {
     switch ($column) {
         case 'compatible_versions' or 'incompatible_versions':
             parent::__set($column, serialize($value));
             break;
         default:
             parent::__set($column, $value);
             break;
     }
 }
예제 #21
0
파일: user.php 프로젝트: jimktrains/rccms
 public function __set($column, $value)
 {
     $this->load_prefs();
     if (!count($this->_prefs) and strlen($this->prefs)) {
         $this->prefs = json_decode($this->prefs);
     }
     try {
         return parent::__set($column, $value);
     } catch (Kohana_Exception $e) {
         $this->_prefs[$column] = $value;
     }
 }
예제 #22
0
 public function __set($key, $value)
 {
     if ($key === $this->columns['password']) {
         if ($this->loaded and $value === '') {
             // Do not set empty passwords
             return;
         }
         // Use Auth to hash the password
         $value = A1::instance($this->config_name)->hash_password($value);
     }
     parent::__set($key, $value);
 }
예제 #23
0
파일: user.php 프로젝트: andyst/gallery3
 public function __set($column, $value)
 {
     switch ($column) {
         case "hashed_password":
             $column = "password";
             break;
         case "password":
             $this->password_length = strlen($value);
             $value = user::hash_password($value);
             break;
     }
     parent::__set($column, $value);
 }
예제 #24
0
 public function __set($key, $value)
 {
     try {
         $value = parent::__set($key, $value);
     } catch (Exception $e) {
         $metadata = ORM::factory('document_metadata')->where('document_id', $this->id)->where('key', $key)->find();
         if (!$metadata->loaded) {
             $metadata->key = $key;
             $metadata->document_id = $this->id;
         }
         $metadata->value = $value;
         $metadata->save();
     }
     return $value;
 }
 /**
  * Override set handler to translate WKT to PostGIS internal spatial data.
  */
 public function __set($key, $value)
 {
     if ($key === 'geom_value') {
         if ($value) {
             $row = $this->db->query("SELECT ST_GeomFromText('{$value}', " . kohana::config('sref_notations.internal_srid') . ") AS geom")->current();
             $value = $row->geom;
         }
     }
     parent::__set($key, $value);
 }
예제 #26
0
 public function __set($key, $value)
 {
     if ($key === 'id') {
     }
     parent::__set($key, $value);
 }
예제 #27
0
 /**
  * Base set method - this should not be overridden.
  *
  * @param  string $column  Column name
  * @param  mixed  $value   Column value
  * @return void
  */
 public function __set($column, $value)
 {
     if ($column == $this->scope_column and !$this->use_scope) {
         return;
     }
     parent::__set($column, $value);
 }
예제 #28
0
 public function __set($key, $value)
 {
     parent::__set($key, $value);
 }
예제 #29
0
 /**
  * Produces writable properties for the class object
  * @author	Brent Allen
  * @param	string	key	name of the variable to set
  * @param	*		val	data to set the property to
  * @return 	null	
  */
 public function __set($key, $val)
 {
     switch ($key) {
         case 'title':
             $this->establishData();
             $this->_data->title = $val;
             break;
         case 'desc':
         case 'description':
             $this->establishData();
             $this->_data->description = $val;
             break;
         case 'exp':
         case 'expiration_date':
         case 'expiration':
             $this->establishData();
             $this->_data->expiration = date('Y-m-d', strtotime($val));
             break;
         case 'avail':
         case 'available':
             $this->establishData();
             $this->_data->available = date('Y-m-d', strtotime($val));
             break;
         case 'display':
             $this->establishData();
             $this->_data->display = $val;
             break;
         case 'enabled':
             $this->establishData();
             $this->_data->enabled = $val;
             break;
         case 'deleted':
             $this->establishData();
             $this->_data->deleted = $val;
             break;
         default:
             parent::__set($key, $val);
             break;
     }
 }